![](/img/trans.png)
[英]Python 3.6 in Visual Studio 2017 How to Run Program in the Interactive Shell
[英]How do you run a python program in visual studio
每當我按f5鍵運行程序時, launch.json
打開一個名為launch.json
的新文件,我不知道該怎么做。 有誰知道要做什么,不,這與我為Visual Studio安裝python一樣。 這就是launch.json
樣子。
{
"version": "0.2.0",
"configurations": [
{
"name": "Python",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"program": "${file}",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
]
},
{
"name": "Python Console App",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"program": "${file}",
"externalConsole": true,
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit"
]
},
{
"name": "Django",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"program": "${workspaceRoot}/manage.py",
"args": [
"runserver",
"--noreload"
],
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput",
"DjangoDebugging"
]
},
{
"name": "Watson",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"program": "${workspaceRoot}/console.py",
"args": [
"dev",
"runserver",
"--noreload=True"
],
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
]
}
]
}
提前致謝 !
我猜你是說VS Code。 如果是這種情況,這是一個自動生成的文件,您可以在其中配置按F5
時將發生的情況。 如果按原樣保存該文件,然后切換回main.py
或要調試的任何python文件,然后再次按F5
鍵,則將在第一個可執行行的斷點開始調試。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.