11 2024 档案

摘要:#用于动态操作对象,但性能开销较大 class T(): name1 = 'test1' name2 = 'test2' def __init__(self, name4): self.name3 = 'test3' self.name4 = name4 def f1(self): print('f 阅读全文
posted @ 2024-11-25 21:01 尐少 阅读(2) 评论(0) 推荐(0) 编辑
摘要:import logging logging.debug('debug') logging.info('info') # 正常执行时debug、info 日志不输出 logging.warning('waring') logging.error('error') logging.critical(' 阅读全文
posted @ 2024-11-20 21:00 尐少 阅读(21) 评论(0) 推荐(0) 编辑
摘要:# configparser import configparser config = configparser.ConfigParser() config['DB'] = { 'host': '10.10.10.10', 'port': 3306 } config['DEFAULT'] = { ' 阅读全文
posted @ 2024-11-20 20:58 尐少 阅读(2) 评论(0) 推荐(0) 编辑
摘要:# hash # hash() 将数据转换成一个数字的算法 """在同一次执行过程中,对同一个可hash的值进行计算得到的值是相同的,类似内存地址""" print(hash('123')) # 6690882297275263703 print(hash("123")) # 66908822972 阅读全文
posted @ 2024-11-18 21:25 尐少 阅读(4) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示