In Python 3, add the following to the end of your code:
input('Press ENTER to exit')
This will cause the program to wait for user input, with pressing ENTER causing the program to finish.
You can double click on your script.py
file in Windows conveniently this way.
More Related Contents:
- How do I copy a string to the clipboard?
- “python” not recognized as a command
- Windows cmd encoding change causes Python crash
- Getting MAC Address
- Which is the easiest way to simulate keyboard and mouse on Python?
- Is there a way to list all the available Windows’ drives?
- fcntl substitute on Windows
- Python Window Activation
- Python command not working in command prompt
- Using Python, how can I access a shared folder on windows network?
- python ctypes issue on different OSes
- Detecting Mouse clicks in windows using python
- Accessing CPU temperature in python
- Python running as Windows Service: OSError: [WinError 6] The handle is invalid
- tkinter.TclError: image “pyimage3” doesn’t exist
- pyclipper installation error: “tp_print is not a member of _typeobject”
- Get the title of a window of another program using the process name
- IOError: [Errno 13] Permission denied when trying to open hidden file in “w” mode
- How do I eliminate Windows consoles from spawned processes in Python (2.7)? [duplicate]
- How do I read text from the Windows clipboard in Python?
- How to get the text cursor position in Windows?
- How to change the location of the pointer in python?
- Why python executable opens new window instance when function by multiprocessing module is called on windows
- Running Scapy on Windows with Python 2.7
- Installing lxml, libxml2, libxslt on Windows 8.1
- Trouble installing SciPy on windows
- Installing theano on Windows 8 with GPU enabled
- Python multiprocessing linux windows difference
- How to properly report an exit status in batch?
- Fatal Python error on Windows 10 ModuleNotFoundError: No module named ‘encodings’