2021年1月7日星期四

File not read in Python

When I try to open a .txt or a csv file, the output is not displayed but the code seems to work. It only works when I use a .py file. For example:

import os    path=os.getcwd()  name='data.csv'    with open(path+'/'+name) as files:      data=files.read()    print(data)    output:   
https://stackoverflow.com/questions/65623214/file-not-read-in-python January 08, 2021 at 11:50AM

没有评论:

发表评论