What does “== RESTART <path> ==” in the IDLE Shell mean?

家住魔仙堡 提交于 2019-12-20 05:29:07

问题


I have a simple script I wrote, and when trying to run it (F5) , I get this msg:

================== RESTART: C:\Users\***\Desktop\tst.py ==================

I restarted the shell, reopened the script, but still, the same msg appears. I use python 3.5.1 and I tried to simplify the script as much as possible, but I still get this result. Now my script is only one line with a simple print(1) command and I still get this msg.

Was there something wrong with the shell installation?


回答1:


I have a simple script I wrote, and when trying to run it (F5)

That's the hotkey for IDLE to run a file. It is not ordering to do anything. It's a log statement to explicitly declare that your namespace is being cleared and the file is going to be ran fresh again.

no, I didn't tell it to restart

But you did... You pressed F5




回答2:


The same thing is happening with my shell. In the older versions, this does not happen. I've also noticed that when I press Python 3.5.2 Module Docs, I have my Internet browser open up and I see my directory being displayed onscreen. It looks like:

C:\Users\mycomputername\AppData\Local\Programs\Python\Python35-32\DLLs.

Is that suppose to happen? Is that secured? I don't know.

I've also found that this prints out whenever I "imported" something. So if I use an import command, and put it right before the line of my random name, it will print out that "RESTART" thing. It's always at the beginning. Or what it reads as the beginning.




回答3:


CIsForCookies, my guess is that you don't actually have a complete script; maybe you have just a function definition and you haven't included a line to run that function. (I had this problem and then remembered to call the function I defined; the problem went away.)



来源:https://stackoverflow.com/questions/38627504/what-does-restart-path-in-the-idle-shell-mean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!