【发布时间】:2018-07-10 12:23:16
【问题描述】:
我在 Visual Studio 中打开了一个 python 项目文件夹并运行 getter.py,其中包含以下代码:
getter.py
with open('instruments.txt', 'r') as f:
instrument_list = f.read().splitlines()
我的文件夹树如下:
proj
-downloaders
--getter.py
instruments.txt
signals.py
正如您在上面看到的,getter.py 位于donwloaders 文件夹中。为什么 Visual Studio 在没有FileNotFoundError 的情况下运行上述脚本?请注意,当我将instructions.txt 移动到downloaders 文件夹时,它会抛出FileNotFoundError。我应该更改设置中的某些内容吗?
【问题讨论】:
标签: python visual-studio path