Val*_*ski 1 python visual-studio-code
我在VS Code中运行python脚本时似乎无法打开基本文本文件,在Idle中使用它时代码运行正常,但是VSCode会给我FileNotFound错误,是否有某种扩展名可以让我执行这个?现在,我仅使用Python和Code Runner扩展。我的代码示例:
def getInput(textFile):
    file=open(textFile,'r')
    print(file.readlines())
在 Windows 版 VSCode 中
文件 --> 首选项 --> 设置 --> (用户)扩展 --> Python -->
终端:在文件目录中执行--> 检查它
或者
文件 --> 首选项 --> 设置 --> 搜索设置 --> python.terminal.executeInFileDir
| 归档时间: | 
 | 
| 查看次数: | 3464 次 | 
| 最近记录: |