Files
RSClicker/mouseLocation.py
2023-04-14 11:31:20 -04:00

13 lines
381 B
Python

#! python3
#This displays the location of the mouse in a loop
import pyautogui, sys
print('Press Ctrl-C to quit.')
try:
while True:
x, y = pyautogui.position()
positionStr = 'X: ' + str(x).rjust(4) + ' Y: ' + str(y).rjust(4)
print(positionStr, end='')
print('\b' * len(positionStr), end='', flush=True)
except KeyboardInterrupt:
print('\n')