随笔分类 -  Python

Python之日志处理(logging模块)
摘要:http://www.cnblogs.com/yyds/p/6901864.html 阅读全文
posted @ 2018-12-06 23:21 <Hbw>
python操作Redis缓存
摘要:python操作Redis缓存 https://www.cnblogs.com/guotianbao/p/8683037.html 学习资料: 电子书资源 联系邮箱:gmu1592618@gmail.com flask微电影: movie_project 阅读目录 一、Redis的安装 二、Redi 阅读全文
posted @ 2018-12-05 08:48 <Hbw>
python保留两位小数
摘要:python保留两位小数 python保留两位小数: In [1]: a = 5.026 In [2]: b = 5.000 In [3]: round(a,2) Out[3]: 5.03 In [4]: round(b,2) Out[4]: 5.0 In [5]: '%.2f' % a Out[5 阅读全文
posted @ 2018-12-04 15:43 <Hbw>
设计模式及Python实现
摘要:设计模式及Python实现 目录 设计模式是什么? 设计模式六大原则 接口 创建型模式 1. 简单工厂模式 2. 工厂方法模式(Factory Method) 3. 抽象工厂方法(Abstract Factory) 4. 建造者模式(Builder) 5. 单例模式(Singleton) 6. 原型 阅读全文
posted @ 2018-11-01 08:32 <Hbw>
Python----切片
摘要:Python 切片 在列表操作中,支持索引操作,使用[ 索引 ]取出对应索引的值,Python支持正向索引,也支持负向索引。 alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] # 0 1 2 3 4 5 6 7 8 9 # - 阅读全文
posted @ 2018-11-01 08:30 <Hbw>
Python ---- super()使用
摘要:Python super() 我们经常在类的继承当中使用super(), 来调用父类中的方法。例如下面: 1 2 3 4 5 6 7 8 9 10 11 12 13 class A: def func(self): print('OldBoy') class B(A): def func(self) 阅读全文
posted @ 2018-10-31 23:53 <Hbw>
python——赋值与深浅拷贝
摘要:python——赋值与深浅拷贝 初学编程的小伙伴都会对于深浅拷贝的用法有些疑问,今天我们就结合python变量存储的特性从内存的角度来谈一谈赋值和深浅拷贝~~~ 预备知识一——python的变量及其存储 在详细的了解python中赋值、copy和deepcopy之前,我们还是要花一点时间来了解一下p 阅读全文
posted @ 2018-10-31 23:47 <Hbw>