Skip to content

Instantly share code, notes, and snippets.

@wwex
Last active June 4, 2018 12:59
Show Gist options
  • Save wwex/804d4f1d6d13685ebce3f058d63a1f52 to your computer and use it in GitHub Desktop.
Save wwex/804d4f1d6d13685ebce3f058d63a1f52 to your computer and use it in GitHub Desktop.
[PyMemos - Auto GUI] #python #memo #auto #pyautogui
import pyautogui
print(pyautogui.size())
print(pyautogui.position())
pyautogui.moveTo(10,10, 1.5)
pyautogui.moveRel(200,10, 1.5)
pyautogui.click(400, 200)
pyautogui.doubleClick(400, 200)
pyautogui.middleClick(400, 200)
pyautogui.rightClick(400, 200)
pyautogui.dragRel(400, 200)
pyautogui.displayMousePosition()
pyautogui.typewrite('Hello World!!!', interval=0.2)
pyautogui.press('f1')
pyautogui.hotkey('ctrl', 'o')
pyautogui.screenshot(r'C:\Users\woj.wojciechowski\Desktop\py\screenshot_example.png')
but8_coords = pyautogui.locateOnScreen(r'C:\Users\woj.wojciechowski\Desktop\py\but8.png')
but8_center = pyautogui.locateCenterOnScreen(r'C:\Users\woj.wojciechowski\Desktop\py\but8.png')
print(but8_center) # dla otwartego kalkulatora
pyautogui.moveTo(but8_center, duration=2)
pyautogui.click(but8_center)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment