我在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。我是否应该更改设置中的某些内容?
https://stackoverflow.com/questions/51265108
复制相似问题