当该文件或目录显然是该目录中的文件时,为什么不显示该文件或目录?

时间:2020-02-06 16:13:00

标签: python-3.x file

classes = []
with open(r'D:/classes.txt', 'r') as f:
    for line in f:
        print(line)
        classes.append(line)
for c in classes:
print(c)

这怎么不行?

FileNotFoundError: [Errno 2] No such file or directory: 'D:/classes.txt'

0 个答案:

没有答案