资源简介
基于python;
每天可以给指定人发消息;
可以每天整点定时;

代码片段和文件信息
from __future__ import unicode_literals
from threading import Timer
from wxpy import *
import requests
bot = Bot()
def get_news1():
# 获取金山词霸每日一句,英文和翻译
url = “http://open.iciba.com/dsapi/“
r = requests.get(url)
contents = r.json()[‘content‘]
translation = r.json()[‘translation‘]
return contents translation
def send_news():
try:
my_friend = bot.friends().search(‘dumpling‘)[0]
my_friend.send(get_news1()[0])
my_friend.send(get_news1()[1][5:])
my_friend.send(“Cxs!“)
t = Timer(86400send_news) # 每86400秒(1天),发送1次,不用linux的定时任务是因为每次登陆都需要扫描二维码登陆,很麻烦的一件事,就让他一直挂着吧
t.start()
except:
my_friend = bot.friends().search(‘O_o‘)[0] # 你的微信名称,不是微信帐号。
my_friend.send(u“今天消息发送失败了“)
if __name__ == “__main__“:
send_news()
#https://www.cnblogs.com/jaycekon/archive/2017/07/17/WxpyRedis.html
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1018 2018-04-11 22:31 python每天发消息\Send_Friends.py
目录 0 2018-04-12 00:11 python每天发消息
----------- --------- ---------- ----- ----
1018 2
- 上一篇:实现火车票查询python.zip
- 下一篇:python 打砖块源代码
相关资源
- 二级考试python试题12套(包括选择题和
- pywin32_python3.6_64位
- python+ selenium教程
- PycURL(Windows7/Win32)Python2.7安装包 P
- 英文原版-Scientific Computing with Python
- 7.图像风格迁移 基于深度学习 pyt
- 基于Python的学生管理系统
- A Byte of Python(简明Python教程)(第
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- python人脸识别(opencv)
- python 绘图(方形、线条、圆形)
- python疫情卡UN管控
- python 连连看小游戏源码
- 基于PyQt5的视频播放器设计
- 一个简单的python爬虫
- csv文件行列转换python实现代码
- Python操作Mysql教程手册
- Python Machine Learning Case Studies
- python获取硬件信息
评论
共有 条评论