zoukankan      html  css  js  c++  java
  • python之微信自动发送消息

    代码如下:

    from __future__ import unicode_literals
    from threading import Timer
    from wxpy import *
    import requests
    bot = Bot()     #登录微信
    def send_news():
        try:
            my_friend = bot.friends().search(u'黑子')[0]# 好友的微信号,可以在获取好友列表中找
            my_friend.send(u"知道吗,你是最最最最美的女孩纸!")  #描述自己修改
            t = Timer(1,send_news)# 设置发送时间间隔
            t.start()
        except:
            my_friend = bot.friends().search('执愛。婷^_^')[0]# 自己的微信号
            my_friend.send(u"今天消息发送失败了")    #描述自己修改
    if __name__ == "__main__":
        send_news()
  • 相关阅读:
    113. Path Sum II
    112. Path Sum
    111. Minimum Depth of Binary Tree
    110. Balanced Binary Tree
    Create
    SetWindowPos
    INT_PTR数据类型
    SDK介绍
    COLORREF
    setfont()函数
  • 原文地址:https://www.cnblogs.com/qzzhou/p/10486256.html
Copyright © 2011-2022 走看看