py-autogui/func/location.py
2023-09-14 02:40:30 +08:00

13 lines
300 B
Python

import time
import pyautogui
def print_location():
while True:
x, y = pyautogui.position()
position_str = 'X: ' + str(x).rjust(4) + ' Y: ' + str(y).rjust(4)
print(position_str, end='')
time.sleep(0.1)
print('\b' * len(position_str), end='', flush=True)