microsoft / microsoft/vscode-python-debugger
"Run Python File" returned an error but "Run Python File in Dedicated Terminal" could run successfully.
未关闭
@eleanorjboyd 已经在做这个了。
开始于 2025年2月18日。
triage-needed
- 主要语言
- TypeScript
- 星标
- 181
- 派生
- 126
- 平均合并
- 2 天 3 小时
- 30 天内合并 PR
- 3
描述
x = 3
while x > 0:
x -= 1
print(x)
I run the above code with Run Python File in vscode and it returned an error:
>>> D:/Python313/python.exe c:/Users/colin/Desktop/PracticeAI/PracticeAI.py
File "<python-input-7>", line 1
D:/Python313/python.exe c:/Users/colin/Desktop/PracticeAI/PracticeAI.py
^
SyntaxError: invalid syntax
When I use Run Selection/Line in Python Terminal, it also returned an error:
>>> x = 3
>>> while x > 0:
... x -= 1
... print(x)
...
File "<python-input-9>", line 3
print(x)
IndentationError: unexpected indent
But when I use Run Python File in Dedicated Terminal, it could run smoothly.
C:\Users\colin\Desktop\PracticeAI>D:/Python313/python.exe c:/Users/colin/Desktop/PracticeAI/PracticeAI.py
2
1
0
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
评估
这个 Issue 还没有评估数据。