1from pynput.mouse import Button, Controller
2mouse = Controller()
3
4# move the pointer
5mouse.position = (10, 20)
6
7# Press and release
8mouse.press(Button.left)
9mouse.release(Button.left)
10
11# Double click; this is different from pressing and releasing
12mouse.click(Button.left, 2)
13
14# Scroll two steps down
15mouse.scroll(0, 2)
16