網頁

2019年3月20日 星期三

[python] Use Python to Control the GUI(Mouse, Keyboard, etc)

Install package
under the windows environment
!pip install pyautogui

1. Control the movement of mouse
import pyautogui
for i in range(5):
   pyautogui.moveTo(0, 0, duration=0.5)
   pyautogui.moveTo(1000, 0, duration=0.5)
   pyautogui.moveTo(1000, 1000, duration=0.5)
   pyautogui.moveTo(0, 1000, duration=0.5)
2. continue....

沒有留言:

張貼留言