Python3.6之给指定用户发送微信消息


 

 

#!/usr/bin/python3
# -*- coding: utf-8 -*-

import datetime
import time
import requests
import json

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'})

while 1:
    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("结束")

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM