import pyautogui
import time
try:
while True:
x, y = pyautogui.position()
print(f"Current mouse position: ({x}, {y})", end='\r') # 끝에 '\r'을 추가하여 같은 줄에 출력
time.sleep(0.1) # 0.1초마다 업데이트
except KeyboardInterrupt:
print("\n프로그램이 종료되었습니다.")
(python -m) pip install pyautogui