sys模块
sys.exit()
sys.argvsys.pathlogging模块
logging.basicConfig( level= , format= , filename= , filemode= ,)#无法同时在文件和屏幕输出logging.debuglogging.infologging.warninglogging.errorlogging.criticallogger方法
logger_obj=logging.getlogger()#获取logger对象fh=logging.FileHandler('logger_file.txt)#文件输出ch=logging.StreamHandler()#屏幕输出logger_obj.setLevel(logging.DEBUG)
formater=logging.Formatter()
fh.setFormatter(formater)
ch.setFormatter(formater)logger_obj.addHandler(fh)
logger_obj.addHandler(ch)logger_obj.info('info')
logger_obj.error('error')logger_obj.critical('critical')先序列化再编码
json.dumps()序列化json.loads()反序列化json.dump()
json.load()