每当我在Python Shell中运行程序时,我都会得到一行显示 RESTART:C:\ ... $ .
Whenever I run a program in Python Shell I get a line that says RESTART: C:\... $.
使用过去没有该问题的程序来重启程序,似乎没有任何作用.预先感谢您的任何建议!
Restarting the program, using programs that did not have this issue in the past etc. do not seem to do anything. Thanks in advance for any advice!
这是什么原因造成的?
推荐答案
该行表示 .py 文件已在python shell中执行.
That line means that the .py file has been executed in the python shell.
这是一条日志语句,用于明确声明您的命名空间已清除,并且该文件将再次运行.
It's a log statement to explicitly declare that your namespace is being cleared and the file is going to be ran fresh again.
简单来说:IDLE在执行之前会在内部重新启动您的程序,因此清除了上面所有的信息,所以变量较早版本的程序不会干扰您的程序
In simple words: The IDLE internally restarts itself before executing your program, thus clearing all the information above so the variables from earlier programs will not mess with your program
.
更多推荐
每当我在Python Shell中运行程序时,我都会得到一行重新启动的信息:C:\ ... $
发布评论