我在VS Code中运行python脚本时似乎无法打开基本文本文件,在Idle中使用它时代码运行正常,但是VSCode会给我FileNotFound错误,是否有某种扩展名可以让我执行这个?现在,我仅使用Python和Code Runner扩展。我的代码示例:
def getInput(textFile):
file=open(textFile,'r')
print(file.readlines())
Run Code Online (Sandbox Code Playgroud)