Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wonsolution/2137ebb05ac34189bc60409df6a8f8ae to your computer and use it in GitHub Desktop.
Save wonsolution/2137ebb05ac34189bc60409df6a8f8ae to your computer and use it in GitHub Desktop.
Python-mecro
#install 한 pyautogui import하기
import pyautogui, sys
#마우스 커서 이동할 위치 좌표 : pyautogui.moveTo(x축, y축, 이동시간)
pyautogui.moveTo(1206,189,1)
#마우스 클릭하기
#pyautogui.click()
#특정 좌표 클릭
#pyautogui.click(x=1342, y=586)
#오른쪽 마우스 클릭
pyautogui.click(button='right')
#더블클릭하기
pyautogui.moveTo(1472,363)#더블클릭할 위치
#pyautogui.click(clicks=2)
pyautogui.doubleClick()
#내가 클릭하고 싶은 곳의 마우스 좌표 알아내기
print('현재 마우스 위치')
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')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment