07 2021 档案

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