[英]Visual Studio Code, Python Run/Debug
Whenever I try to run/debug any python script in Visual Studio Code (Ubuntu 16.04), it only executes once and then stops reacting to any debugging command (F5/Ctrl+F5/Shift+F5, etc.). 每当我尝试在Visual Studio Code(Ubuntu 16.04)中运行/调试任何python脚本时,它只会执行一次,然后停止对任何调试命令(F5 / Ctrl + F5 / Shift + F5等)作出反应。
I feel like I am missing something simple, but I haven't found anything related to that issue. 我觉得我缺少一些简单的东西,但是我还没有发现与该问题有关的任何东西。
The MWE: MWE:
import sys
def main(args):
print('123')
sys.exit(0)
if __name__ == '__main__':
main(sys.argv)
'123' is only printed once and there is no indication of running debug afterwards. “ 123”仅打印一次,之后没有运行调试的迹象。
Any help would be highly appreciated. 任何帮助将不胜感激。
I've been having the same issue, and the only ways I have been able to work around this are to either restart Visual Studio Code or to run the script from the terminal. 我遇到了同样的问题,解决此问题的唯一方法是重新启动Visual Studio Code或从终端运行脚本。
For example, a script named myCounter.py would be run with 例如,一个名为myCounter.py的脚本将与
.\\myCounter.py 。\\ myCounter.py
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.