国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術(shù)文章
文章詳情頁

python 實(shí)現(xiàn)控制鼠標(biāo)鍵盤

瀏覽:159日期:2022-07-04 09:09:53

1、安裝類庫

pip install pyautogui

2、代碼:

import pyautogui,time,randompyautogui.PAUSE = 3pyautogui.FAILSAFE = Truewidth, height = pyautogui.size()#print(str(width))#print(str(height))def drawRct(): for i in range(10): pyautogui.moveTo(300, 300, duration=0.25) pyautogui.moveTo(400, 300, duration=0.25) pyautogui.moveTo(400, 400, duration=0.25) pyautogui.moveTo(300, 400, duration=0.25)def mouseScroll(): time.sleep(5) for i in range(10): pyautogui.scroll(-200) time.sleep(2)def getXy(): try: while True: x, y = pyautogui.position() print(x,y) except KeyboardInterrupt: print(’nExit.’)def playVideo(x,y): for i in range(4): pyautogui.click(x,y) x=x+240 playAndComment()def playAndComment(): time.sleep(random.randint(5,15)) pyautogui.scroll(-400) pyautogui.scroll(-400) pyautogui.click(200,300) pyautogui.typewrite(’very good!’) pyautogui.click(900,400) pyautogui.click(710,16)if __name__ == ’__main__’: time.sleep(5) pyautogui.scroll(-300) for i in range(9): print(str(i)) time.sleep(random.randint(3,5)) #pyautogui.click(360,16) pyautogui.scroll(-300) time.sleep(random.randint(1,5)) playVideo(404,330)

以上就是python 實(shí)現(xiàn)控制鼠標(biāo)鍵盤的詳細(xì)內(nèi)容,更多關(guān)于python 控制鼠標(biāo)鍵盤的資料請關(guān)注好吧啦網(wǎng)其它相關(guān)文章!

標(biāo)簽: Python 編程
相關(guān)文章:
主站蜘蛛池模板: 新郑市| 叙永县| 星子县| 吉安市| 五常市| 元朗区| 敦化市| 香港 | 丰县| 桦南县| 上蔡县| 贵阳市| 柳州市| 隆子县| 新密市| 麦盖提县| 法库县| 都匀市| 元氏县| 潢川县| 扎鲁特旗| 凌源市| 宜川县| 沙雅县| 苍山县| 麻城市| 塔城市| 八宿县| 潮安县| 元江| 乃东县| 乡城县| 水城县| 巫溪县| 济阳县| 德清县| 阿鲁科尔沁旗| 西盟| 天峨县| 本溪市| 台州市|