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
1from pynput.keyboard import Key, Controller
2
3keyboard = Controller()
4
5# Press and release space
6keyboard.press(Key.space)
7keyboard.release(Key.space)
1#for backspace
2from pynput.keyboard import Key, Controller
3
4kb = Controller()
5kb.press(Key.backspace)
6kb.release(Key.backspace)