【发布时间】:2019-06-20 04:51:39
【问题描述】:
我的 VS 代码调试文件夹是:
C:\Users\EML\Python Code
我正在使用的文件位于:
C:\Users\EML\Python Code\Boggle
在同一个文件夹中,我有文件 en-dict.txt 但我收到此错误消息
with open("en-dict.txt", "r", encoding="utf8") as file:
FileNotFoundError: [Errno 2] No such file or directory: 'en-dict.txt'
这是我在 VS Code 中的 launch.json 设置:
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"cwd": "${fileDirname}"
}
我查看了许多 StackOverflow 答案,但没有一个对我有帮助。
【问题讨论】:
-
“调试文件夹”是什么意思?以及您在 VS Code 中打开了哪个文件夹(根据您的代码编写方式,它应该是
C:\Users\EML\Python Code\Boggle)。 -
调试我的意思是我已经在
C:\Users\EML\Python Code中打开了VS代码