随笔分类 -  python

摘要:Pyinstaller 打包用到xlrd3模块的脚本为exe后,exe程序无法读取.xlsx文件故障解决 需要在xlrd3模块下,xlsx.py中开头位置加入此语句: import xml.etree.ElementTree 阅读全文
posted @ 2021-06-03 16:45 M兔 阅读(114) 评论(0) 推荐(0)
摘要:XlsxWriter 1.优点 一、功能比较强 相对而言,这是除Excel自身之外功能最强的工具了。比如我就用到了它提供的:字体设置、前景色背景色、border设置、视图缩放(zoom)、单元格合并、autofilter、freeze panes、公式、data validation、单元格注释、行 阅读全文
posted @ 2020-08-12 16:07 M兔 阅读(207) 评论(0) 推荐(0)
摘要:1、json字典 阅读全文
posted @ 2020-06-10 13:44 M兔 阅读(131) 评论(0) 推荐(0)
摘要:支持dict、list、普通数据类型对象比较 def compare(src, des): if type(src) != type(des): return False if isinstance(src, (str, int, float)): if src == des: return Tru 阅读全文
posted @ 2020-06-08 17:44 M兔 阅读(655) 评论(0) 推荐(0)
摘要:一、python中对文件、文件夹操作时经常用到的os模块和shutil模块常用方法。1.得到当前工作目录,即当前Python脚本工作的目录路径: os.getcwd()2.返回指定目录下的所有文件和目录名:os.listdir()3.函数用来删除一个文件:os.remove()4.删除多个目录:os 阅读全文
posted @ 2019-12-25 09:25 M兔 阅读(514) 评论(0) 推荐(0)
摘要:1.装饰器 不更改原来函数的内容,给原函数增加额外功能。 def myDecorator(func): def wraper(*args,**kwargs):# *args,**kwargs 兼容各种参数,也可以无参。 start_time = time.time() f= func(*args,* 阅读全文
posted @ 2019-11-15 11:40 M兔 阅读(145) 评论(0) 推荐(0)
摘要:1.首先创建一个定时任务管理的类 创建一个 ScheduleTask.py,定义一个类 class ScheduleConfig(object): JOBS = [ { 'id': '配置文件校验任务', #任务名,自己随便起 'func': 'service.ConfigCheckService: 阅读全文
posted @ 2019-11-07 10:27 M兔 阅读(543) 评论(0) 推荐(0)
摘要:1.资料 https://www.cnblogs.com/zhaoyingjie/p/9664081.html http://xiantanluohua.com/index.php/2019/06/22/python-apschedule%E5%AE%9A%E6%97%B6%E4%BB%BB%E5% 阅读全文
posted @ 2019-11-07 10:20 M兔 阅读(283) 评论(0) 推荐(0)
摘要:解决方法: flask 接口无法显示中文,添加: app= Flask(__name__) app.config['JSON_AS_ASCII'] =False flask-restful 接口无法显示中文,添加: app= Flask(__name__) app.config.update(RES 阅读全文
posted @ 2019-10-23 17:39 M兔 阅读(522) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/zjuxsl/article/details/79437563 阅读全文
posted @ 2019-09-17 15:06 M兔 阅读(156) 评论(0) 推荐(0)
摘要:testCase的加载方法,可以参考:https://blog.csdn.net/wushuai150831/article/details/78453073 https://www.cnblogs.com/imyalost/p/9048386.html HTMLTestReportCN.py文件在 阅读全文
posted @ 2019-01-17 13:45 M兔 阅读(1593) 评论(1) 推荐(1)
摘要:1.去掉https的ssl安全验证 在get或post请求中verify=False 例如 requests.get(url, verify=False) 2.解决Python3 控制台输出InsecureRequestWarning的问题 使用Python3 requests发送HTTPS请求,已 阅读全文
posted @ 2019-01-14 13:17 M兔 阅读(364) 评论(0) 推荐(0)
摘要:1. Python is likely shutting down 解决方案https://www.cnblogs.com/drake-guo/p/6188366.html 2. Selenium 报错:Element is not clickable at point的解决办法 org.openq 阅读全文
posted @ 2019-01-09 16:09 M兔 阅读(166) 评论(0) 推荐(0)
摘要:1. Selenium with Python 官方资料 https://selenium-python.readthedocs.io/index.html 2.下载chromedriver.exe http://chromedriver.storage.googleapis.com/index.h 阅读全文
posted @ 2019-01-09 15:38 M兔 阅读(108) 评论(0) 推荐(0)
摘要:1. json转换时,中文乱码 设置参数 ensure_ascii=False解决 https://blog.csdn.net/u014431852/article/details/53058951 2. https请求时关闭ssl安全验证 pip.exe install MySQL-python 阅读全文
posted @ 2018-10-23 13:42 M兔 阅读(131) 评论(0) 推荐(0)
摘要:1. dict 与json互转 在Python语言中,json数据与dict字典以及对象之间的转化,是必不可少的操作。 在Python中自带json库。通过import json导入。 在json模块有2个方法, loads():将json数据转化成dict数据 dumps():将dict数据转化成 阅读全文
posted @ 2018-10-17 15:22 M兔 阅读(1482) 评论(0) 推荐(0)