user1027046 user1027046 - 1 year ago 89
Python Question

how to pause a program until a button is pressed

I am using py2exe to make executable.
I want to know how to pause the program until a button is pressed.. just like we do in C using


As the program terminates automatically in windows, I need this tool.

Is there anything better than py2exe which does similar work ?

Answer Source

You can use raw_input in Python2, or input in Python 3

raw_input("Press Enter to terminate.")
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download