[英]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.