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

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

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

瀏覽:117日期: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 實現(xiàn)控制鼠標(biāo)鍵盤的詳細(xì)內(nèi)容,更多關(guān)于python 控制鼠標(biāo)鍵盤的資料請關(guān)注好吧啦網(wǎng)其它相關(guān)文章!

標(biāo)簽: Python 編程
相關(guān)文章:
主站蜘蛛池模板: 玛曲县| 武义县| 洛扎县| 伊吾县| 绥阳县| 恩施市| 丹巴县| 内乡县| 元阳县| 安乡县| 康马县| 靖西县| 灌云县| 运城市| 怀化市| 黎川县| 监利县| 东辽县| 兴安县| 平山县| 沈丘县| 辛集市| 建瓯市| 梁河县| 临夏县| 开原市| 临泉县| 珠海市| 梓潼县| 绵竹市| 广元市| 绥化市| 天门市| 吐鲁番市| 新疆| 双牌县| 车险| 轮台县| 长武县| 侯马市| 金川县|