我的问题似乎很简单,但我有一个模块,我在这样的终端上启动:
bash
python -m my_module.my_file
如何在Visual Studio代码中调试它。
我的launch.json
(documentation)里有这个
"type": "python",
"request": "launch",
"pythonPath": "D:\\ProgramData\\Anaconda3\\envs\\simulec\\python.exe",
"args": [
"-m",
"my_module.my_file",
]
如果我没有设置program
选项,或者将其设置为""
,则会出现“文件不存在”错误。
知道吗? 提前谢谢
实际上,我在尝试编辑
launch.json
时偶然发现了一个非常简单的选项。只需在模块键中指定模块
"module": "my_module.my_file"
-m
不再有用相关问题 更多 >
编程相关推荐