簡體   English   中英

FileNotFoundError: [Errno 2] 沒有這樣的文件或目錄,但有一個文件

[英]FileNotFoundError: [Errno 2] No such file or directory but there is a file

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'

導航到保存這兩個文件的文件夾(使用cd )(即,它們應該在同一目錄中)並從終端運行程序。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM