#for backspace from pynput.keyboard import Key, Controller kb = Controller() kb.press(Key.backspace) kb.release(Key.backspace)