FileNotFoundError:[Errno 2]没有这样的文件或目录,但有一个文件

时间:2018-02-28 17:20:26

标签: python file-not-found

fhand=open('mbox.txt')

mbox.txt文件在我的桌面上,但是python shell无法找到它。这就是追溯。

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'mbox.txt'

1 个答案:

答案 0 :(得分:0)

导航到使用两个文件保存的文件夹(使用cd)(即它们应该在同一目录中),然后从终端运行程序。

相关问题