Ubuntu安装 pyautogui 模块

sudo pip3 install python3-xlib
sudo apt-get install scrot
sudo apt-get install python3-tk
sudo apt-get install python3-dev
sudo pip install pyautogui #【不加sudo会出错】

检验 在交互环境运行:

        import pyautogui 


应用一:刷百家好访问量脚本

#!/usr/bin/python3.5
import pyautogui
import time
print("请在3秒内选择点击位置...")

for i in range(1,4):
	time.sleep(1)
	print(i)

a,b = pyautogui.position()

print(a,b)

for i in range(1,200):
	pyautogui.click(a,b,button='left')
	time.sleep(2)
	print(i)




你可能感兴趣的:(笔记,python)