Advertisement
182days

Print Mouse Position

Nov 25th, 2023
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. import pyautogui
  2. import time
  3.  
  4. while True:
  5.     # Get the current mouse coordinates
  6.     x, y = pyautogui.position()
  7.  
  8.     # Print the coordinates
  9.     print(f"Mouse coordinates: x = {x}, y = {y}")
  10.     time.sleep(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement