- Beranda
- Programmer Forum
Pyautogui
...
TS
striver
Pyautogui
Code:
>>> import pyautogui
>>> screenWidth, screenHeight = pyautogui.size()
>>> currentMouseX, currentMouseY = pyautogui.position()
>>> pyautogui.moveTo(100, 150)
>>> pyautogui.click()
>>> pyautogui.moveRel(None, 10) # move mouse 10 pixels down
>>> pyautogui.doubleClick()
>>> pyautogui.moveTo(500, 500, duration=2, tween=pyautogui.easeInOutQuad) # use tweening/easing function to move mouse over 2 seconds.
>>> pyautogui.typewrite('Hello world!', interval=0.25) # type with quarter-second pause in between each key
>>> pyautogui.press('esc')
>>> pyautogui.keyDown('shift')
>>> pyautogui.press(['left', 'left', 'left', 'left', 'left', 'left'])
>>> pyautogui.keyUp('shift')
>>> pyautogui.hotkey('ctrl', 'c')
Pyautogui digunakan untuk mengotomatisasi pekerjaan. Contoh di atas adalah untuk otomatis menghapus attribute sets di magento dengan script
Diubah oleh striver 18-11-2019 21:29
nona212 memberi reputasi
1
817
2
Komentar yang asik ya
Mari bergabung, dapatkan informasi dan teman baru!
Programmer Forum
20.3KThread•5.1KAnggota
Urutkan
Terlama
Komentar yang asik ya