每当我在Python Shell中运行程序时,我都会得到一行重新启动的信息:C:\ ... $ [英] Whenever I run a program in Python Shell I get a line that says RESTART: C:\... $

查看:61
本文介绍了每当我在Python Shell中运行程序时,我都会得到一行重新启动的信息:C:\ ... $的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我在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:\ ... $的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆