QQ消息群发助手(超级简单)
Posted ryueifu-vba
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了QQ消息群发助手(超级简单)相关的知识,希望对你有一定的参考价值。
大家好!我开发的小工具,效果见动图:
下载地址
代码:
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()
以上是关于QQ消息群发助手(超级简单)的主要内容,如果未能解决你的问题,请参考以下文章