how to get mouse pointer location in python code example Example: py get mouse coordinates import pyautogui pos = pyautogui.position()