[英]FileNotFoundError: [Errno 2] No such file or directory but there is a file
fhand=open('mbox.txt')
mbox.txt file is in my desktop but python shell can't find it. mbox.txt 文件在我的桌面上,但 python shell 找不到它。 And this is the traceback.
这就是回溯。
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'mbox.txt'
Navigate into the folder (using cd
) in which you have saved both the files (ie, they should be in the same directory) and run the program from the terminal.导航到保存这两个文件的文件夹(使用
cd
)(即,它们应该在同一目录中)并从终端运行程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.