说出来你可能不相信,我在用命令行给你发微信

用命令行发微信,试过吗?很有趣,更有趣的是用for循环,

简单教程如下:

先安装itchat包:

pip install itchat

然后:

>>python

再然后就可以用命令行运行python代码

import itchat
itchat.auto_login()#会有二维码出来,扫二维码
users=itchat.search_friends(name=u'马熠辉')#可以是备注名字,也可以是昵称
userName=users[0]['UserName']
itchat.send(u'说出来你可能不相信,我在用命令给你发微信',userName)

再写个for循环的:

for i in range(10):
    itchat.send(u'我就想问你牛逼不牛逼!',userName)

如果在windows窗口命令行运行for循环语句,写完循环体之后按两次Enter键就可以了。

更多信息请参考:

1.https://blog.csdn.net/enweitech/article/details/79585043

2. http://itchat.readthedocs.io/zh/latest/tutorial/tutorial0/

猜你喜欢

转载自blog.csdn.net/mieleizhi0522/article/details/80613928