I am running command-line Python scripts from the Windows taskbar by having a shortcut pointing to the Python interpreter with the actual script as a parameter.
Afte
In Windows, you can use the msvcrt module.
msvcrt.kbhit() Return true if a keypress is waiting to be read.
msvcrt.getch() Read a keypress and return the resulting character. Nothing is echoed to the console. This call will block if a keypress is not already available, but will not wait for Enter to be pressed.
If you want it to also work on Unix-like systems you can try this solution using the termios and fcntl modules.