[英]Have to type exit() every time in visual studio code terminal before running python program again?
I am using visual studio code to run a simple program, but every time I run the program in terminal, once it is finished it gets stuck as if I am still in python in the terminal.我正在使用 Visual Studio 代码运行一个简单的程序,但是每次我在终端中运行程序时,一旦完成它就会卡住,就好像我还在终端中的 python 中一样。 I say this because it leaves me with the three arrows after I finish the program.我这样说是因为在我完成程序后它给我留下了三个箭头。
">>>" >>>>"
(ie I need to go down to the integrated terminal window in VSC and type exit() before I run the program again or it will throw invalid syntax errors because VSC is trying to use bash command line commands while I am still in python. (ie I need to go down to the integrated terminal window in VSC and type exit() before I run the program again or it will throw invalid syntax errors because VSC is trying to use bash command line commands while I am still in python.
You can select Run Python File in Terminal
instead of Run Selection/Line in Python Terminal
, equals click the run button on the top-left of the VSCode.您可以 select Run Python File in Terminal
而不是Run Selection/Line in Python Terminal
,等于单击 VSCode 左上角的运行按钮。
And if you want to get out of python, you can take the shortcut of Ctrl+Z
too.如果你想退出 python,你也可以使用Ctrl+Z
的快捷键。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.