Last active
June 4, 2018 12:59
-
-
Save wwex/804d4f1d6d13685ebce3f058d63a1f52 to your computer and use it in GitHub Desktop.
[PyMemos - Auto GUI] #python #memo #auto #pyautogui
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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