摘要: 用 __new__方法 #_*_ encoding: utf-8 _*_ @author: ty hery 2019/9/6 class Singleton(object): def __new__(cls): if not hasattr(cls,'_instance'): cls._instan 阅读全文
posted @ 2021-04-10 22:56 ty1539 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 函数的列表作为默认参数带来的问题 #_*_ encoding: utf-8 _*_ @author: ty hery 2019/9/5 def extendList(val, list=[]): print('这个是开始之前列表: ',list) list.append(val) print(f'这 阅读全文
posted @ 2021-04-10 22:49 ty1539 阅读(97) 评论(0) 推荐(0) 编辑
摘要: #_*_ encoding: utf-8 _*_ @author: ty hery 2019/9/6 def multipliers(): return [lambda x : i * x for i in range(4)] print ([m(2) for m in multipliers()] 阅读全文
posted @ 2021-04-10 22:30 ty1539 阅读(61) 评论(0) 推荐(0) 编辑
摘要: ##生成器版斐波那契 #_*_ encoding: utf-8 _*_ @author: ty hery 2019/9/5 def fibonacci(): a,b=0,1 while True: yield b a,b = b, a+b fib=fibonacci() print(type(fib 阅读全文
posted @ 2021-04-10 22:25 ty1539 阅读(230) 评论(0) 推荐(0) 编辑
摘要: # 查出类的所有key值 cls.__table__.columns.keys() cls.__table__.columns.values() self.__class__.__name__ __get__方法详解: https://blog.csdn.net/qq_34979346/articl 阅读全文
posted @ 2021-04-10 22:12 ty1539 阅读(90) 评论(0) 推荐(0) 编辑
摘要: #_*_ encoding: utf-8 _*_ @author: ty hery 2019/9/6 def table_things(**kwargs): for name, value in kwargs.items(): print ('{0} = {1}'.format(name, valu 阅读全文
posted @ 2021-04-10 22:07 ty1539 阅读(261) 评论(0) 推荐(0) 编辑
摘要: #_*_ encoding: utf-8 _*_ @author: ty hery 2019/9/6 class Parent(object): x = 1 class Child1(Parent): pass class Child2(Parent): pass print (Parent.x, 阅读全文
posted @ 2021-04-10 22:00 ty1539 阅读(99) 评论(0) 推荐(0) 编辑
摘要: cmd里的快捷键 ctrl+a : 跳到开头 ctrl+e : 跳到结尾 which vi 查看vi这么命令在哪个目录下 >> /uer/bin/vi git log 太多了看不完, 空格 往下看 q退出 ctrl+f往后走, ctrl+d 往前走 mkdir a && cd - 创建并进入啊目录 阅读全文
posted @ 2021-04-09 11:08 ty1539 阅读(1032) 评论(0) 推荐(0) 编辑
摘要: https://www.ixigua.com/6835268628095435271?id=6836958720258212359&logTag=9d395df5acc953382c22 一、MySQL架构图 并发控制 存储引擎 日志 redo log undo log binlog 慢查询日志 单 阅读全文
posted @ 2021-04-05 18:23 ty1539 阅读(46) 评论(0) 推荐(0) 编辑
摘要: 此篇文章比较详细,写了些(?P\d+)等分组: https://www.cnblogs.com/zjltt/p/6955965.html https://www.cnblogs.com/shenjianping/p/11647473.html python-re模块 .,[],\d,\w,\s,\S 阅读全文
posted @ 2021-04-04 15:22 ty1539 阅读(69) 评论(0) 推荐(0) 编辑