python常用模块收集
1,钉钉群发送消息模块
dingtalkchatbot
代码块
from dingtalkchatbot.chatbot import DingtalkChatbot bot = DingtalkChatbot("https://oapi.dingtalk.com/robot/send?access_token=e1cc3164e60d27ef5d84d4fca8a4cfc16a5208750168f8206aede2eccfe341a0") bot.send_text("test1,报警",is_at_all=True) #secret="SECfead946c147a8c4c9b38fe3c38186bdd2561edad99add35b5bf4d36b8a639d7a" #secret是机器人安全设置中的一个选项,如果勾选了,就写道bot里面去,作为函数Dingtalkchatbot的一个参数
#bot = DingtalkChatbot("https://oapi.dingtalk.com/robot/send?access_token=e1cc3164e60d27ef5d84d4fca8a4cfc16a5208750168f8206aede2eccfe341a0",
secret="SECfead946c147a8c4c9b38fe3c38186bdd2561edad99add35b5bf4d36b8a639d7a")
2,flask 模块
创建一个新的web应用
from flask import Flask app = Flask(__name__) @app.route("/") def first_flask(): return "hello world" if __name__ == "__main__": app.run(port=80,debug=True)