随笔分类 -  Python

摘要:集合推导式[i for i in in_list if % 2 != 0]条件表达式even_odd = 'even' if x % 2 == 0 else 'odd' 阅读全文
posted @ 2026-01-29 13:18 狗狗听话 阅读(4) 评论(0) 推荐(0)
摘要:import os, datetimefrom datetime import datefrom pathlib import Pathfile_path = "C:\\Users\\mengchen.shao\\Desktop\\BET"path = Path(file_path)for file 阅读全文
posted @ 2025-12-29 15:03 狗狗听话 阅读(7) 评论(0) 推荐(0)
摘要:* =COUNTIF(BET!A:A,A2))* =COUNTIFS(BET!A:A,A2,BET!G:G,"赢")* =COUNTIFS(BET!A:A,A2,BET!G:G,"输")* =SUMIF(BET!A:A,B2,BET!J:J)-SUMIF(BET!A:A,B2,BET!I:I)* = 阅读全文
posted @ 2024-06-21 16:22 狗狗听话 阅读(27) 评论(0) 推荐(0)
摘要:1.解压缩文件 2.压缩文件夹 # 压缩文件夹# dir_path: 压缩文件夹路径# zip_file_name:压缩后的zip文件名称和文件夹路径def zip_folder(dir_path, zip_file_name): with zipfile.ZipFile(f'{zip_file_n 阅读全文
posted @ 2023-08-29 11:16 狗狗听话 阅读(17) 评论(0) 推荐(0)
摘要:def strB2Q(ustring): rstring = "" for uchar in ustring: inside_code = ord(uchar) if inside_code == 32: inside_code = 12288 elif 32 <= inside_code <= 1 阅读全文
posted @ 2023-08-21 17:04 狗狗听话 阅读(37) 评论(0) 推荐(0)
摘要:Pip pip 是 Python 包管理工具,该工具提供了对Python 包的查找、下载、安装、卸载的功能, 绝大部分的第三方库都可以用pip来安装,用起来很方便。 常用命令集合 安装软件包:pip install package(包名) 卸载软件包:pip install package 升级软件 阅读全文
posted @ 2022-11-29 09:11 狗狗听话 阅读(61) 评论(0) 推荐(0)
摘要:1. __init__.py __init__.py主要作用:将普通文件夹标识为python包来管理 1.每个python模块都包括__init__.py文件 2.在文件定义__all__用来模糊导入 阅读全文
posted @ 2021-01-14 11:15 狗狗听话 阅读(224) 评论(0) 推荐(0)
摘要:1.本地log基本使用 核心代码 def log_config(self, cfg): # 创建一个 logger logger = logging.getLogger('upload file') logger.setLevel(logging.DEBUG) # 设置日志级别 # 创建一个文件处理 阅读全文
posted @ 2020-11-11 14:28 狗狗听话 阅读(762) 评论(0) 推荐(0)
摘要:1.字典 2.列表 阅读全文
posted @ 2019-12-26 13:53 狗狗听话 阅读(135) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-12-26 10:27 狗狗听话 阅读(116) 评论(0) 推荐(0)