python用gui控制鼠标和键盘

mac上依次顺序安装:
pip3 install pyobjc-framework-Quartz
pip3 install pyobjc-core
pip3 install pyobjc
pip3 install pyautogui
下面这段代码会自动打开mac上的记事本,然后键入对应文本

import time,pyautogui
pyautogui.click(523,735)
try:
    while True:
        time.sleep(2)
        pyautogui.typewrite('HI,DuoDuo,How are you today.\n',0.25)
except KeyboardInterrupt:
        print('\nDone.')
发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>