under linux:
import os
def getch():
os.system('bash -c "read -n 1"')
getch()
under windows:
from msvcrt import getch
Figuring out which operating system is running:
>>> import platform
>>> platform.system()
'Linux'
>>>