PyAutoGUI lets your Python scripts control the mouse and keyboard to automate interactions with other applications. The API is designed to be simple. PyAutoGUI works on Windows, macOS, and Linux, and runs on Python 2 and 3.
A Python tool called PyAutoGUI enables you to automate your GUI and programmatically manage your keyboard and mouse. Since PyAutoGUI is not included with Python, enter the following line at the command prompt to install it:
pip3 install PyAutoGUI
Full documentation can find here : https://pyautogui.readthedocs.io/en/latest/