大家好,我又回来啦!!!
最近的新研究,用py3给微信指定用户发送消息
#!/usr/bin/python3
# -*- coding: utf-8 -*-
importdatetime
importtime
importrequests
importjson
github_url ="http://192.168.1.70:8080/robot/messageServlet2"
data = json.dumps({'name':'test','phone':139})
url ='http://192.168.1.70:8080/robot/messageServlet2'
# r = requests.post(url, data={'name': 'test', 'phone': 'some test repo'})
while1:
now = datetime.datetime.now()
now_str = now.strftime('%Y/%m/%d %H:%M:%S')[11:]
print('\r{}'.format(now_str),end='')
r = requests.post(url,data={'name':'test','phone':139,'content':'内容'})
print(r.text.data)
time.sleep(1)
print("结束")
亲测可用,内含定时功能
领取专属 10元无门槛券
私享最新 技术干货