#!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
import json
import sys
import os
headers = {'Content-Type': 'application/json;charset=utf-8'}
api_url = "https://oapi.dingtalk.com/robot/send?access_token=xxxxxx"
def msg(text):
json_text= {
"msgtype": "text",
"at": {
"atMobiles": [
"120xxx", "130xxx"
],
"isAtAll": False
},
"text": {
"content": text
}
}
print requests.post(api_url,json.dumps(json_text),headers=headers).content
if __name__ == '__main__':
text = sys.argv[1]
msg(text)
最后
以上就是高挑果汁最近收集整理的关于python发钉钉_python发送钉钉机器人脚本的全部内容,更多相关python发钉钉_python发送钉钉机器人脚本内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复