随笔分类 - Python
摘要:集合推导式[i for i in in_list if % 2 != 0]条件表达式even_odd = 'even' if x % 2 == 0 else 'odd'
阅读全文
摘要:import os, datetimefrom datetime import datefrom pathlib import Pathfile_path = "C:\\Users\\mengchen.shao\\Desktop\\BET"path = Path(file_path)for file
阅读全文
摘要:* =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)* =
阅读全文
摘要:1.解压缩文件 2.压缩文件夹 # 压缩文件夹# dir_path: 压缩文件夹路径# zip_file_name:压缩后的zip文件名称和文件夹路径def zip_folder(dir_path, zip_file_name): with zipfile.ZipFile(f'{zip_file_n
阅读全文
摘要:def strB2Q(ustring): rstring = "" for uchar in ustring: inside_code = ord(uchar) if inside_code == 32: inside_code = 12288 elif 32 <= inside_code <= 1
阅读全文
摘要:Pip pip 是 Python 包管理工具,该工具提供了对Python 包的查找、下载、安装、卸载的功能, 绝大部分的第三方库都可以用pip来安装,用起来很方便。 常用命令集合 安装软件包:pip install package(包名) 卸载软件包:pip install package 升级软件
阅读全文
摘要:1. __init__.py __init__.py主要作用:将普通文件夹标识为python包来管理 1.每个python模块都包括__init__.py文件 2.在文件定义__all__用来模糊导入
阅读全文
摘要:1.本地log基本使用 核心代码 def log_config(self, cfg): # 创建一个 logger logger = logging.getLogger('upload file') logger.setLevel(logging.DEBUG) # 设置日志级别 # 创建一个文件处理
阅读全文

浙公网安备 33010602011771号