How to stop Python program execution in IDLE

greye picture greye · Mar 17, 2010 · Viewed 51.4k times · Source

I have a python script that uses plt.show() as it's last instruction. When it runs, IDLE just hangs after the last instruction. I get the image but I don't get the prompt back.

On other scripts I typically use ctrl-c to break the program (sometimes doesn't work immediately) but how do I get the prompt back with the plt.show()? Ctrl-c doesn't work...

Are there other ways to stop the program?

This is IDLE on Windows, if it makes any difference.

Answer

hexicle picture hexicle · Dec 16, 2013

Ctrl+F6 (Restart shell)

or Shell->Restart Shell