??????.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:Easy-wechat-script 作者: awefight 项目源码 文件源码
def start(location=LOCATION, report_time=REPORT_TIME):

    if datetime.datetime.now().strftime('%H:%M') == report_time: #?? 03:25
        weather = ''
        count = 0
        while not weather:
            weather = get_weather(location)
            count += 1
            print('??????%d?' % count)
            time.sleep(1)
            if count >= 10:
                break
        if not weather:
            print('????????')
        else:
            #???????
            for USER_NAME in USER_NAME_LIST:
                num = itchat.search_friends(name = USER_NAME)[0]["UserName"]
                try:
                    itchat.send_msg(get_weather(location), num)
                except Exception as e:
                    print(e)
                #print(get_weather(location))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号