microsoft / microsoft/vscode-python-debugger

"Run Python File" returned an error but "Run Python File in Dedicated Terminal" could run successfully.

オープン
#614 コメント 3 件 リアクション 0 件 担当者 1 名 GitHub で見る

@eleanorjboyd がすでに取り組んでいます。

2025年2月18日 から。

triage-needed
主要言語
TypeScript
スター
181
フォーク
126
平均マージ
2日 3時間
マージ済み PR(30日)
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


コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。