代码拉取完成,页面将自动刷新
import time
import queue
import requests
import json
def wx_msg(corp_id, secret,agentid,msg):
try:
values = {'corpid' :corp_id,
'corpsecret':secret
}
req = requests.post('https://qyapi.weixin.qq.com/cgi-bin/gettoken',params=values)
token = json.loads(req.text)["access_token"]
#try:
dict_arr = {"touser": "@all",
"toparty": "@all",
"msgtype": "text",
"agentid": agentid,
"text": {"content": msg},
"safe": "0"}
data = json.dumps(dict_arr,ensure_ascii=False,indent=2,sort_keys=True).encode('utf-8')
reqs = requests.post("https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token="+token,data)
except Exception as e:
with open('微信发送失败:'+str(int(time.strftime("%H%M%S")))+'.log') as f:
f.write(e)
def Send_wx():
with open('每日选股'+str(int(time.strftime("%Y%m%d")))+'.EBK') as f:
d=f.read()
wx_msg('wx87780fb826353ecc','XlOvsTpuNaINPsV2Wm6TMRLt_k1lgxZjJwrSaVND0Lo',1000003,d)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。