Browse Source

Update 'README.md'

天问 11 months ago
parent
commit
f7a39b7d8a
1 changed files with 21 additions and 0 deletions
  1. 21 0
      README.md

+ 21 - 0
README.md

@@ -1,2 +1,23 @@
 # pyautogui
 
+控制鼠标和键盘,截图等操作,用于自动化任务、测试脚本
+
+## Usage
+
+```
+import pyautogui
+import time
+
+# 移动鼠标到屏幕中央
+pyautogui.moveTo(pyautogui.size()[0] / 2, pyautogui.size()[1] / 2)
+
+# 等待1秒钟
+time.sleep(1)
+
+# 在当前位置点击鼠标
+pyautogui.click()
+
+
+pyautogui.press('space')
+```
+