- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 Visual Studio 的 Python Tools for Visual Studio
中(url)当你有一个 Python 项目文件时,会有一个 Startup File 的概念。 .
Each Python project has one assigned start-up file, shown in boldface in Solution Explorer. The startup file is the file that's run when you start debugging (F5 or Debug > Start Debugging) or when you run your project in the Interactive window (Shift+Alt+F5 or Debug > Execute Project in Python Interactive). To change it, right-click the new file and select Set as Startup File.
VSCode
中的等价物是什么?的 Python 扩展?如何定位我目录中的特定文件以使用从我的
launch.json
中选择的当前调试设置运行文件
最佳答案
原来是 program
属性。
program - executable or file to run when launching the debuggerhttps://code.visualstudio.com/docs/editor/debugging#_launchjson-attributes
{
"name": "python launch foo",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/d1/d2/foo.py",
"cwd": "${workspaceFolder}",
"args": [ "${env:USERNAME}", "--optionX", "x1000" ]
"console": "integratedTerminal"
}
以前我只是用默认的
file
复制启动配置变量,它总是只运行工作区中打开的任何事件文件。
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"cwd": "${workspaceFolder}",
}
关于python - 如何在 VSCode Python 扩展中指定启动文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54430216/
我是一名优秀的程序员,十分优秀!