07 2021 档案
摘要:log 等级: DEBUG 、INFO、WARNING(默认)、ERROR、CRITICAL 依次递增,意味着如果setLevel设为INFO,那么可以记录INFO及以上的log 如何将log同时输出到控制台和本地文件 配置文件:utils.py # 配置log,logger是日志对象,handle
阅读全文
摘要:import hashlib hl = hashlib.md5() hl.update(Object) hl.hexdigest()
阅读全文
摘要:四种方法: # 第一种 os.path.exists(file_path) # 第二种 os.path.isfile(file_path) # 第三种 pathlib模块 # 第四种 os.access(file_path,mode) # 第五种 try+open() 或者with open() 示
阅读全文
摘要:1. 定义:Assert statements are a convenient way to insert debugging assertions into a program 2.依赖于__debug__变量,默认值为True 当不满足条件返回False 3.使用场景:检查先验条件时使用断言,
阅读全文

浙公网安备 33010602011771号