# -*- coding: utf-8 -*-
from pymouse import PyMouse
from gevent.hub import sleep
import pythoncom
import pyHook
import time
import threading
from pymouse import PyMouse
def clickWeibo():
m = PyMouse()
while True:
m.click(20L, 747L)
sleep(1)
def onKeyboardEvent(event):
if str(event.Key) == 'S': #按下键盘S启动自动点击
t = threading.Thread(target=clickWeibo)
t.setDaemon(True) #设置主线程结束时自动杀死子线程
t.start()
if str(event.Key) == 'E': #按下键盘E退出程序
exit()
return True
hm = pyHook.HookManager()
hm.KeyDown = onKeyboardEvent
hm.HookKeyboard()
pythoncom.PumpMessages()
鼠标自动点击 python版
最新推荐文章于 2024-08-24 06:15:00 发布