Python Development QQ Batch Login

Source: Internet
Author: User

Operation Steps:

1. Open QQ Software

2. Move the mouse to the QQ input place

3. At the input, click the mouse, enter the account number

4. Simulate Press TAB key, enter password, simulate point enter login

#coding =utf-8 import OS import Win32gui import win32api import win32con import SendKeys import time from Ctyp ES import * #多次登录qq, incoming account password def qqload (qq,pwd): #使用系统模块os, open QQ #必须是单引号 + double quotes to run Os.system (' "C:\Program Fi Les (x86) \tencent\qq\bin\qqsclauncher.exe "') #留给qq界面点响应时间 Time.sleep (0.2) # Gets the handle of the window, Parameter 1: class name, Parameter 2: Title hand Le = Win32gui. FindWindow (None, ' QQ ') #返回指定窗口的显示状态以及被恢复的, maximized and minimized window position logid = Win32gui.      GetWindowPlacement (handle) Print Logid #设置鼠标位置, the horizontal axis is equal to the left upper corner number plus the input box from the left edge of the difference, the ordinate is equal to the number of upper left and the input box from the upper boundary of the difference #差值可用工具, measured pixel difference Windll.user32.SetCursorPos (logid[4][0]+310,logid[4][1]+280) #模拟鼠标点击操作, left-click First, then release Win32api.mouse_event (Win32con. mouseeventf_leftdown,0,0,0,0) win32api.mouse_event (Win32con. mouseeventf_leftup,0,0,0,0) #!!      Note that it must be delayed to enter correctly, otherwise the input error time.sleep (0.2) #安装SendKeys库, you can automatically enter the content Sendkeys.sendkeys (QQ) Time.sleep (0.2)  #按下tab键, switch to the input password #模拟键盘操作, check the keyboard corresponding ASC code, the tab corresponds to the ASC code is 9 #先按下, and then released    Win32api.keybd_event (9,0,0,0) win32api.keybd_event (9,0,win32con. keyeventf_keyup,0) Time.sleep (0.2) #输入密码, click Enter to sign in to Sendkeys.sendkeys (PWD) time.sleep (0.2) Win32API. keybd_event (13,0,0,0) win32api.keybd_event (13,0,win32con. keyeventf_keyup,0) If __name__ = = ' __main__ ': #在文件中读取帐号密码信息 fn = ' D:\info.txt ' FR = open (FN, ' R '). Readlin ES () #循环打开每一行, use split to divide the list for i in fr:info = I.split ('----') qqload (str (info[0]), str (info[1])   )

  

Python Development QQ Batch Login

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.