随笔分类 -  Python

摘要:1、peewee:https://blog.51cto.com/u_11866025/5659600 批量插入数据 #第一种Person.insert_many([ ('张三', 30, date(1990, 1, 1)), ('李四', 40, date(1980, 1, 1)), ('王五', 阅读全文
posted @ 2023-05-11 15:55 淡怀 阅读(34) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Time : @Author : @File :dbDataTool.py @Version :1.0 数据入库出库处理相关工具 @Function: """ import hashlib SPLI 阅读全文
posted @ 2022-12-09 10:16 淡怀 阅读(170) 评论(0) 推荐(0) 编辑
摘要:list = [1, 2, 3, 4] list = ''.join(str(i) for i in list) print(list) 阅读全文
posted @ 2022-11-28 15:24 淡怀 阅读(481) 评论(0) 推荐(0) 编辑
摘要:pip install psutil if __name__ == '__main__': import psutil battery = psutil.sensors_battery() plugged = battery.power_plugged percent = str(battery.p 阅读全文
posted @ 2022-10-25 22:17 淡怀 阅读(109) 评论(0) 推荐(0) 编辑
摘要:moviepy官网:http://doc.moviepy.com.cn/ 一、安装 【不建议 慢】pip install moviepy 【建议 快】pip install moviepy -i http://pypi.douban.com/simple/ --trusted-host pypi.d 阅读全文
posted @ 2022-09-09 16:13 淡怀 阅读(171) 评论(0) 推荐(0) 编辑
摘要:1、不勾选inherit global site-packages 2、【推荐】勾选inherit global site-packages 阅读全文
posted @ 2022-08-14 12:36 淡怀 阅读(1642) 评论(0) 推荐(0) 编辑
摘要:from xpinyin import Pinyin if __name__ == '__main__': ''' 1 获取汉字对应的拼音(含声调) [tone_marks参数控制 marks-符号;numbers-数字] ''' # 1.1 声调为符号 print(Pinyin().get_pin 阅读全文
posted @ 2022-08-02 22:01 淡怀 阅读(1275) 评论(0) 推荐(0) 编辑
摘要:一、报错 PS E:\WebUIAutomatedTest> pytest --html=report.html Traceback (most recent call last): File "D:\Python3.9.12\AZ\lib\runpy.py", line 197, in _run_ 阅读全文
posted @ 2022-07-22 14:14 淡怀 阅读(224) 评论(0) 推荐(0) 编辑
摘要:1、Python爬虫IP代理教程,让你不再为IP被封禁发愁! 2、接口调用查看本机IP GET:http://httpbin.org/ip 阅读全文
posted @ 2022-07-08 12:02 淡怀 阅读(212) 评论(0) 推荐(0) 编辑
摘要:参考 阅读全文
posted @ 2022-06-20 18:58 淡怀 阅读(26) 评论(0) 推荐(0) 编辑
摘要:if __name__ == '__main__': dictStr = "{'A':'aValue'}" print(type(dictStr), dictStr) # 字符串字典 转 字典 print(type(eval(dictStr)), eval(dictStr)) # 字符串字典 转 字 阅读全文
posted @ 2022-06-10 10:22 淡怀 阅读(63) 评论(0) 推荐(0) 编辑
摘要:一、打开word文档 def openWord(): """ 自动打开当前路径下的 “操作教程.doc” 文档 :return: """ from win32com import client as wc wordPath = os.path.join(os.getcwd(), '操作教程.doc' 阅读全文
posted @ 2022-05-25 15:27 淡怀 阅读(336) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Time :2022/5/23 9:48 @Author : @File :observer.py @Version :1.0 @Function:观察者模式/监听模式 """ """ 观察者基类 阅读全文
posted @ 2022-05-23 19:41 淡怀 阅读(118) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/sinat_38682860/article/details/93388503?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7 阅读全文
posted @ 2022-05-17 14:28 淡怀 阅读(25) 评论(0) 推荐(0) 编辑
摘要:一、报错 二、排查 1、报错说不能找到enum.Enum这个东西 但是通过代码定位 能够找到(这时候就要想到 肯定有一个包名或者py文件名称是enum 造成冲突了) 2、果不其然 自己代码这里有个包名是enum 改名称后 就正常了 阅读全文
posted @ 2022-05-02 17:05 淡怀 阅读(1680) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/dingmanzzz/article/details/113449275 if __name__ == '__main__': pa = r'C:\Users\hha\Desktop\002594.txt' # 获取文件路径 print(os.path.d 阅读全文
posted @ 2022-04-07 00:34 淡怀 阅读(59) 评论(0) 推荐(0) 编辑
摘要:https://www.jianshu.com/p/1c7dc6669311 阅读全文
posted @ 2022-04-06 10:00 淡怀 阅读(43) 评论(0) 推荐(0) 编辑
摘要:一、浏览器中的请求头复制到文件中 二、代码解析 #!/usr/bin/env python # -*- coding: utf-8 -*- """ @Time :2022/4/3 22:37 @Author : @File :header.py @Version :1.0 @Function: "" 阅读全文
posted @ 2022-04-03 22:53 淡怀 阅读(786) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Time :2022/3/31 23:55 @Author : @File :TimeCalc.py @Version :1.0 @Function: """ class TimeCalc: @st 阅读全文
posted @ 2022-04-01 00:24 淡怀 阅读(282) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示