import keyboard, time from pynput import keyboard keeppressed = {} pushnumber=0 pushprerel=0 def on_press(key): global pushtime global pushnumber global pu