python实战===一键刷屏

#当按键q的时候,自动输入 “大家好!”并回车键发送!
from
pynput import keyboard from pynput.keyboard import Key, Controller kb = Controller() def on_release(key): try: if key.char == "q": kb.type(u'大家好!!!') kb.press(Key.enter) kb.release(Key.enter) except: pass while True: with keyboard.Listener( on_release = on_release) as listener: listener.join()

 

posted @ 2018-01-28 11:28  AAA五金批发王建军  阅读(1961)  评论(0编辑  收藏  举报