QQ消息群發助手(超級簡單)


 大家好!我開發的小工具,效果見動圖:

下載地址 

QQ群發助手.rar

代碼:

 1 def Login():
 2     global Flag
 3     try:
 4         bot.Login(['-q',v1.get()])
 5         tkinter.messagebox.showinfo(message="登陸成功")
 6         Flag=1
 7     except Exception as e:
 8         tkinter.messagebox.showerror(message=str(e))
 9 def Send():
10     global Flag
11     if Flag==0:
12         tkinter.messagebox.showwarning(message='您還沒有登陸,不能發送消息!')
13         return ''
14     content= T1.get(1.0, tkinter.END)
15     if vOption.get() == 1:
16         Friends=bot.List('buddy')
17     elif vOption.get() == 2:
18         Friends = bot.List('group')
19     for friend in Friends:
20         if v2.get() in friend.name:
21             try:
22                 bot.SendTo(friend, content)
23             except Exception as e:
24                 tkinter.messagebox.showerror(message=str(e))
25     tkinter.messagebox.showinfo(message="發送完畢")
26 if __name__ == '__main__':
27     root = tkinter.Tk()
28     L1 = tkinter.Label(root, text='QQ賬號')
29     L1.place(x=10,y=10,height=30)
30     v1 = tkinter.StringVar()
31     E1 = tkinter.Entry(root, textvariable=v1)
32     E1.place(x=60,y=10,width=120,height=30)
33     B1 = tkinter.Button(root, text='登陸', command=Login)
34     B1.place(x=190,y=10,width=50,height=30)
35     vOption = tkinter.IntVar(value=1)
36     R1 = tkinter.Radiobutton(root, text='發給所有好友', variable=vOption, value=1)
37     R1.place(x=10,y=50)
38     R2 = tkinter.Radiobutton(root, text='發給所有群', variable=vOption, value=2)
39     R2.place(x=10,y=70)
40     L2 = tkinter.Label(root, text='名稱包含')
41     L2.place(x=130,y=60)
42     v2 = tkinter.StringVar()
43     E2 = tkinter.Entry(root, textvariable=v2)
44     E2.place(x=190,y=60,width=50)
45     T1 = tkinter.Text(root)
46     T1.place(x=10,y=110,width=230,height=100)
47     B1 = tkinter.Button(root, text='發送', command=Send)
48     B1.place(x=10, y=220, width=230, height=30)
49     Flag=0
50     root.resizable(False, False)
51     root.title('劉永富-QQ群發工具')
52     root.geometry('250x250+300+300')
53     root.mainloop()


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM