上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 14 下一页
摘要: [TOC] 原文: "https://www.cnblogs.com/yuanchenqi/article/5732581.html" 模块(Module)和包(Package) 模块(modue)的概念 在计算机程序的开发过程中,随着程序代码越写越多,在一个文件里代码就会越来越长,越来越不容易维护 阅读全文
posted @ 2019-11-29 20:50 月零Ray 阅读(352) 评论(0) 推荐(0)
摘要: 练习目的: 1.函数编程 2.文件处理 3.tag的用法 4.程序的解耦 文件内容:haproxy.conf global log 127.0.0.1 local2 daemon maxconn 256 log 127.0.0.1 local2 info defaults log global mo 阅读全文
posted @ 2019-11-29 20:18 月零Ray 阅读(181) 评论(0) 推荐(0)
摘要: 原文:https://www.cnblogs.com/linhaifeng/articles/6140395.html 1.装饰器 器即函数 装饰即修饰,意指为其他函数添加新功能 装饰器定义:本质就是函数,功能是为其他函数添加新功能 2.装饰器原则 1.不修改被装饰函数的源代码(开放封闭原则) 2. 阅读全文
posted @ 2019-11-29 16:20 月零Ray 阅读(154) 评论(0) 推荐(0)
摘要: 转载: 老男孩 Python 基础知识练习(三):https://www.cnblogs.com/nulige/p/6128674.html 1、列举布尔值为 False 的值空,None,0, False, '', [], {}, () 2、写函数:根据范围获取其中 3 和 7 整除的所有数的和, 阅读全文
posted @ 2019-11-28 20:42 月零Ray 阅读(656) 评论(0) 推荐(0)
摘要: import time def consumer(name): print('我是[%s],我准备开始吃包子了' %name) while True: baozi=yield time.sleep(1) print('%s 很开心的把【%s】吃掉了' %(name,baozi)) def produ 阅读全文
posted @ 2019-11-28 20:10 月零Ray 阅读(128) 评论(0) 推荐(0)
摘要: 转载:https://www.jianshu.com/p/ccb5e7da3fd8 https://www.cnblogs.com/xhcdream/p/8304953.html https://www.cnblogs.com/wushuaishuai/p/9212812.html send方法和n 阅读全文
posted @ 2019-11-28 12:05 月零Ray 阅读(258) 评论(0) 推荐(0)
摘要: 借鉴:https://www.cnblogs.com/lovezwfjc/p/9300031.html https://www.cnblogs.com/jianguo221/p/8977465.html 1.递归和迭代的区别 https://www.zhihu.com/question/202783 阅读全文
posted @ 2019-11-24 22:05 月零Ray 阅读(290) 评论(0) 推荐(0)
摘要: 1.函数复习 # map # l = [1,2,3,4,5] # print(list(map(str,l))) # reduce # l = [1,2,3,4,5] # from functools import reduce # print(reduce(lambda x,y:x+y,l,3)) 阅读全文
posted @ 2019-11-24 17:57 月零Ray 阅读(262) 评论(0) 推荐(0)
摘要: 原文:https://www.cnblogs.com/linhaifeng/articles/5984922.html 文件处理流程: 1. 打开文件,得到文件句柄并赋值给一个变量2. 通过句柄对文件进行操作3. 关闭文件 #1. 打开文件的模式有(默认为文本模式): r ,只读模式【默认模式,文件 阅读全文
posted @ 2019-11-07 19:38 月零Ray 阅读(170) 评论(0) 推荐(0)
摘要: python内置函数1:https://www.cnblogs.com/raitorei/p/11813694.html # max,min高级玩法 # l=[1,3,100,-1,2] # print(max(l)) # print(min(l)) # # # print(list(zip(('a 阅读全文
posted @ 2019-11-07 18:39 月零Ray 阅读(207) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 14 下一页