How to add a "Press enter to close this window" message to your Python script

Just add this line at the bottom of your Python script:

press_enter_close.py
input("Press Enter to close this window...")

Python 2 variant:

example.py
raw_input("Press Enter to close this window...")

 


Check out similar posts by category: Python