python小记

最近有匹骚猪用微信骚扰我,我很是气愤,

自学一波脚本:

学习目的:用脚本回击回去,通过py写一个脚本,一次性给别人发n条消息;

 

 

  mac上自学python;

brew install python3(自动安装pip3)

可以通过命令查看  brew info python3

 

安装库

pip3 install -U wxpy

 

一切准备就绪,下面写个脚本:

vi a.py

#!/usr/bin/python
#coding=utf-8

from wxpy import *

bot = Bot()

tuling = Tuling(api_key='8c02ae3f727a48669c52ca6ed5db2c48')

@bot.register()
def print_others(msg):
 print(msg)


my_friend = bot.friends().search(u'陈泽勇', sex=MALE,)[0]
#group = bot.groups().search(u'debug')[0]

#@bot.register(group)
#def reply_gua_pi(msg):
# print(msg)
# print(tuling.do_reply(msg))


for i in range(0,100):
 my_friend.send(u'啪啪啪')



#for member in group:
# print(member)
#print(group)
#print(my_friend)
embed()

 

输入命令运行即可: 

python3 a.py

 

 

 

over。。。

posted @ 2017-07-03 14:57  ctgu_czy  阅读(146)  评论(0编辑  收藏  举报