1from pynput.keyboard import Key, Controller
2
3keyboard = Controller()
4keyboard.press(Key.space)
5keyboard.release(Key.space)
6
7keyboard.press('a')
8keyboard.release('a')
9
10# Type two upper case As
11keyboard.press('A')
12keyboard.release('A')
13with keyboard.pressed(Key.shift):
14 keyboard.press('a')
15 keyboard.release('a')
16
17keyboard.type('Hello World')
18
1#for backspace
2from pynput.keyboard import Key, Controller
3
4kb = Controller()
5kb.press(Key.backspace)
6kb.release(Key.backspace)