from graphics import * from time import sleep win = GraphWin('test', 500, 500) while True: sleep(0.1) key = win.checkKey() print(key)