본문 바로가기

개발자 모드/파이썬(python)

파이썬 마우스 클릭 좌표 프린트 하기

728x90
from pynput import mouse

def on_click(x, y, button, pressed):
    print('Button: %s, Position: (%s, %s), Pressed: %s ' %(button, x, y, pressed))


with mouse.Listener(
    on_click=on_click) as listener:
    listener.join()

 

인터넷에서 퍼온 소스코드임

 

자동화 프로그램 활용시에 사용많이함 !!!

 

728x90