pyautogui 마우스 커서 좌표점 실시간

Martin·2024년 8월 11일
0

QA

목록 보기
1/1
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

0개의 댓글