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

您的位置:首頁技術文章
文章詳情頁

python 實現控制鼠標鍵盤

瀏覽:95日期: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 實現控制鼠標鍵盤的詳細內容,更多關于python 控制鼠標鍵盤的資料請關注好吧啦網其它相關文章!

標簽: Python 編程
相關文章:
主站蜘蛛池模板: 图木舒克市| 玉山县| 湘乡市| 大城县| 扶风县| 汕尾市| 武平县| 泰州市| 津市市| 巴林左旗| 哈尔滨市| 河北省| 溆浦县| 祁门县| 双牌县| 新平| 安远县| 昌都县| 济源市| 延川县| 于都县| 宁陵县| 怀化市| 武城县| 洛扎县| 勐海县| 巩义市| 廉江市| 彰武县| 客服| 成都市| 城口县| 邳州市| 永川市| 将乐县| 内黄县| 永靖县| 吕梁市| 溧阳市| 临沂市| 苏尼特右旗|