1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
from wxpy import * import time import random
bot = Bot()
def send_news(): data=[] data.append('xxx')
n=0 while 1: try: my_friend = bot.friends().search(u'Zkk')[0] my_friend.send(data[n]) n+=1 if n==len(data): return time.sleep(480) except: my_friend = bot.friends().search('Zkk')[0] my_friend.send(u"今天消息发送失败了") if __name__ == "__main__": send_news()
|