So I just started learning Python and just now set up my Notepad++ to run it via cmd prompt. Is there a simple way to stop my cmd prompt from auto-exiting when I run a simple program? Do I need to ask for input every time or something or is there an easier way?
I tried raw_input('Press Enter to exit') but no luck.
Here’s the program my introduction to python book started me with http://pastebin.com/ZVJrUzZZ
If it makes any difference I’m running it straight to python.exe in python version 3.2
You have the right idea. You would need to put something like
raw_input()somewhere before the script exits.If this is python 3, use
inputinstead ofraw_input: