随笔分类 - Python
摘要:#!/usr/bin/python2.7#_*_coding:utf-8 _*_#auther:拿来用用import requests,sys,jsonimport urllib3urllib3.disable_warnings()def GetTokenFromServer(Corpid,Secr
阅读全文
摘要:获取微信企业的corpID,sercret,access_token,部门设置列表 zabbix调用微信发短信可能用到的一些变量,获取方式如下: 1.corpID(公司ID) 在我的企业--企业信息 中 2.管理组凭证密钥(公司sercret) 企业应用中,你的自建应用,点解进去,会看到appid和
阅读全文
摘要:d={'a':1,'c':3,'b':2} # 首先建一个字典d d.items() # 得到: dict_items([('a', 1), ('c', 3), ('b', 2)]) L=list(d.items()) # 得到列表: L=[('a', 1), ('c', 3), ('b', 2)]
阅读全文
摘要:python中的正则表达式(re模块)
阅读全文
摘要:re.match与re.search的区别 re.match只匹配字符串的开始,如果字符串开始不符合正则表达式,则匹配失败,函数返回None;而re.search匹配整个字符串,直到找到一个匹配。 实例 #!/usr/bin/python import re line = "Cats are sma
阅读全文
摘要:python3.7安装, 解决pip is configured with locations that require TLS/SSL问题 python3.7安装, 解决pip is configured with locations that require TLS/SSL问题1.安装相关依赖
阅读全文
摘要:python 怎么像shell -x 一样追踪脚本运行过程 [root@localhost keepalived]# python -m trace --trace mysql_start.py modulename: threading, funcname: settracethreading.p
阅读全文