Please note: This wiki is currently running in test mode after an attack on January 5 2013. All passwords were reset, so you will have to use the password recovery function to get a new password. To edit wiki pages, please log in first. See the wiki attack description page for more details. If you find problems, please report them to the pydotorg-www mailing list.

Your search query "linkto:"Asking for Help/Stop 'Hello World' from flashing"" didn't return any results. Please change some terms and refer to HelpOnSearching for more information.
(!) Consider performing a full-text search with your search terms.

Clear message

Asking for Help: How do I stop the console/terminal/command line prompt from closing on Windows?

Ok so, Let's say I want to run a program with a simple Print("hello world"). How do I stop the console/terminal/command line prompt from closing immediately after it prints? I read somewhere that I'm supposed to find some editpythonprefs, but I don't know where it is... I am on Windows 7, if that helps


Are you running the program from the file manager or do you already have the console open when running the program (by typing python hello.py, for example)? If the former is involved, which I suspect is the case, you could prevent the program from finishing by inserting something like the following at the end:

raw_input("Press Enter to exit.")

I found a question about this by searching the Internet for "prevent Python program from exiting on Windows". You'll find other more complicated suggestions if you follow various links from that question, but sometimes the simplest solutions are the best (or are at least good enough).


CategoryAskingForHelp CategoryAskingForHelpAnswered