上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页
摘要: 1.安装相应的编译工具 在root用户下(不要用普通用户,麻烦),全部复制粘贴过去,一次性安装即可. yum -y groupinstall "Development tools" yum -y install zlib-devel bzip2-devel openssl-devel ncurses 阅读全文
posted @ 2020-02-16 13:15 梦乡尘子 阅读(15) 评论(0) 推荐(0)
摘要: 执行结果 验证1 验证2 函数打印了 验证3 阅读全文
posted @ 2020-02-15 13:58 梦乡尘子 阅读(119) 评论(0) 推荐(0)
摘要: ```python class CarFactory: '''python实现单例工厂模式''' __obj = None __flg_init = True def __new__(cls, *args, **kwargs): if cls.__obj is None: cls.__obj = object.__new__(CarFactory) return cls.__obj def __i 阅读全文
posted @ 2020-02-15 13:39 梦乡尘子 阅读(180) 评论(0) 推荐(0)
摘要: ```python class CarFactory: '''用Python实现工厂模式''' def creatCar(self, car_name): if car_name == 'Benz': car = Benz() elif car_name == 'BMW': car = BMW() else: car = BYD() return car class Benz: def __ini 阅读全文
posted @ 2020-02-15 13:38 梦乡尘子 阅读(131) 评论(0) 推荐(0)
摘要: ```python class MySingleton: '''这是一种简单的单例设计模式的实现方式''' __obj = None __flag_init = True def __new__(cls, *args, **kwargs): if cls.__obj is None: cls.__obj = object.__new__(cls) return cls.__obj def __in 阅读全文
posted @ 2020-02-15 13:17 梦乡尘子 阅读(112) 评论(0) 推荐(0)
摘要: 执行的效果: 阅读全文
posted @ 2020-02-14 15:35 梦乡尘子 阅读(289) 评论(0) 推荐(0)
摘要: ![](https://img2018.cnblogs.com/blog/1926349/202002/1926349-20200211220534889-2012768413.png) 阅读全文
posted @ 2020-02-11 22:06 梦乡尘子 阅读(85) 评论(0) 推荐(0)
摘要: ![](https://img2018.cnblogs.com/blog/1926349/202002/1926349-20200211213302648-88230856.png) ![](https://img2018.cnblogs.com/blog/1926349/202002/1926349-20200211213721783-1984502987.png) 阅读全文
posted @ 2020-02-11 21:33 梦乡尘子 阅读(123) 评论(0) 推荐(0)
摘要: ![](https://img2018.cnblogs.com/blog/1926349/202002/1926349-20200211212002259-380979480.png) ![](https://img2018.cnblogs.com/blog/1926349/202002/1926349-20200211212119842-644765963.png) ![](https://im 阅读全文
posted @ 2020-02-11 21:25 梦乡尘子 阅读(127) 评论(0) 推荐(0)
摘要: ![](https://img2018.cnblogs.com/blog/1926349/202002/1926349-20200211211104986-2074989832.png) ![](https://img2018.cnblogs.com/blog/1926349/202002/1926349-20200211211421677-891733714.png) 阅读全文
posted @ 2020-02-11 21:20 梦乡尘子 阅读(84) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页