相关疑难解决方法(0)

Python open()给出IOError:Errno 2没有这样的文件或目录

出于某种原因,我的代码无法打开一个简单的文件:

这是代码:

file1 = open('recentlyUpdated.yaml')
Run Code Online (Sandbox Code Playgroud)

错误是:

IOError: [Errno 2] No such file or directory: 'recentlyUpdated.yaml'
Run Code Online (Sandbox Code Playgroud)
  • 当然,我检查了这是文件的正确名称.
  • 我试过移动文件,给出文件open()的完整路径,似乎没有任何工作.

python file-io file filenotfoundexception file-not-found

56
推荐指数
3
解决办法
30万
查看次数