日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

python實現控制電腦鼠標和鍵盤,登錄QQ的方法示例

系統 1839 0

本文實例講述了python實現控制電腦鼠標和鍵盤,登錄QQ的方法。分享給大家供大家參考,具體如下:

            
import os
from pynput.mouse import Button,Controller
from pynput.keyboard import Key
from pynput.keyboard import Controller as W
from time import sleep
mouse = Controller()
keyboard = W()
#點擊右下角刷新桌面圖標
mouse.position = (1433, 884)
mouse.press(Button.left)
mouse.release(Button.left)
sleep(2)
#打開QQ(跟進QQ具體路徑來設置)
os.startfile("C:\Program Files (x86)\Tencent\QQ\Bin\QQScLauncher.exe")
mouse = Controller()
#讀取鼠標位置
# sleep(5)
# print('當前指針坐標位置是{}'.format(mouse.position))
sleep(2)
mouse.position = (654, 340)
mouse.press(Button.left)
mouse.release(Button.left)
sleep(1)
mouse.position = (729, 489)
keyboard.press(Key.tab)
keyboard.release(Key.tab)
keyboard.press(Key.tab)
keyboard.release(Key.tab)
keyboard.press(Key.tab)
keyboard.release(Key.tab)
keyboard.press(Key.tab)
keyboard.release(Key.tab)
keyboard.press(Key.tab)
keyboard.release(Key.tab)
keyboard.press(Key.tab)
keyboard.release(Key.tab)
#輸入QQ賬號
keyboard.type("QQ賬號")
sleep(1)
#輸入密碼
keyboard.press(Key.tab)
keyboard.release(Key.tab)
keyboard.type("QQ密碼")
#QQ密碼指針坐標位置是(765, 551)
keyboard.press(Key.enter)
keyboard.release(Key.enter)


          

更多關于Python相關內容感興趣的讀者可查看本站專題:《Python進程與線程操作技巧總結》、《Python Socket編程技巧總結》、《Python數據結構與算法教程》、《Python函數使用技巧總結》、《Python字符串操作技巧匯總》、《Python入門與進階經典教程》及《Python文件與目錄操作技巧匯總》

希望本文所述對大家Python程序設計有所幫助。


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 吉首市| 延边| 德令哈市| 涿鹿县| 浦北县| 武夷山市| 兴业县| 宁国市| 彰武县| 庐江县| 义马市| 安陆市| 长汀县| 宁城县| 富宁县| 邵阳市| 兴国县| 阿城市| 曲水县| 孟州市| 萨嘎县| 汨罗市| 新田县| 马山县| 尖扎县| 石家庄市| 平南县| 云浮市| 江山市| 静海县| 苏州市| 新乡市| 韶山市| 临城县| 桦南县| 阳高县| 松滋市| 开封县| 通化县| 商洛市| 贞丰县|