08 2021 档案

摘要:多线程threading模块例子 import threading import time flag = True def fun01(): global flag time.sleep(5) flag = False if flag else True print("flag:" + str(fl 阅读全文
posted @ 2021-08-27 00:05 绣幕 阅读(52) 评论(0) 推荐(0)
摘要:sed 用法 / /开启匹配模式ased '1,3a\hello world' 1.txt 1-3行追加hellosed '/3/a\hello' 1.txt 匹配3追加hello i sed '1i\hello' 1.txt 第一行前插入 sed '/3/i\hello' 1.txt 匹配插入ds 阅读全文
posted @ 2021-08-15 01:22 绣幕 阅读(78) 评论(0) 推荐(0)
摘要:python manage.py inspectdb > [your app name]\models.py 执行后 model.py乱码,将models.py以 UTF-16LE打开。 阅读全文
posted @ 2021-08-07 17:35 绣幕 阅读(243) 评论(0) 推荐(0)
摘要:对象的引用 使用**只是拷贝了字典的最外层,加个deepcopy可以实现深拷贝,递归的去复制对象 bug来源: 在一次将数据库里的数据转成json格式过程中,在遍历数据库对象时,对象的引用不当,导致最后的数据全被遍历的最后一个对象覆盖。 阅读全文
posted @ 2021-08-07 16:29 绣幕 阅读(34) 评论(0) 推荐(0)