摘要: Ansible 通过读取默认的主机清单配置/etc/ansible/hosts,可以同时连接到多个远程主机上执行任务, 默认路径可以通过修改 ansible.cfg 的 hostfile 参数指定路径。 一、Hosts and Groups(主机与组) 对于/etc/ansible/hosts最简单 阅读全文
posted @ 2021-01-27 10:29 小飞侠Kobe 阅读(126) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/haishiniu123/p/6774081.html 迭代器协议: 1.迭代器协议是指:对象必须提供一个next方法,执行该方法要么返回迭代中的下一项,要么就引起一个StopIteration异常,以终止迭代 (只能往后走不能往前退) 2.可迭代对象 阅读全文
posted @ 2018-07-26 17:35 小飞侠Kobe 阅读(225) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/linhaifeng/articles/5984922.html 阅读全文
posted @ 2018-07-25 23:09 小飞侠Kobe 阅读(241) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/linhaifeng/articles/5984922.html 阅读全文
posted @ 2018-07-24 17:39 小飞侠Kobe 阅读(155) 评论(0) 推荐(0) 编辑
摘要: www.cnblogs.com/linhaifeng/articles/5984922.html 阅读全文
posted @ 2018-07-24 15:07 小飞侠Kobe 阅读(200) 评论(0) 推荐(0) 编辑
摘要: ord函数 显示对用的ASCII码值 print(ord('a')) 运行结果: 97 pow函数 print(pow(2,3)) #2**3 print(pow(2,3,3)) #2**3%3 运行结果: 8 2 reversed函数 l=[1,2,3,4] print(list(reversed(l))) print(l) 运行结果: [4, 3, 2, 1] [1, 2, 3, 4] ... 阅读全文
posted @ 2018-07-23 16:44 小飞侠Kobe 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 1.max函数处理的是可迭代对象,相当于一个for循环取出每个元素进行比较。注意:不同类型数据之间不能进行比较。2.每个元素间进行比较,是从每个元素的第一个位置依次比较,如果这一个位置分出大小,后面的都不需要比较了,直接得出这俩元素的大小。 阅读全文
posted @ 2018-07-19 17:26 小飞侠Kobe 阅读(176) 评论(0) 推荐(1) 编辑
摘要: zip函数 zip函数里传的是序列(元祖,字符串,列表) 阅读全文
posted @ 2018-07-19 11:07 小飞侠Kobe 阅读(86) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/linhaifeng/articles/6113086.html —————————————————————————————————————— 1.Map函数 #实现列表每个数字变为它的平方 运行结果: [1, 9, 16, 5041, 4] #如果我 阅读全文
posted @ 2018-06-03 18:30 小飞侠Kobe 阅读(182) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/linhaifeng/articles/6113086.html —————————————————————————————————————— 十、函数式编程 高阶函数:1.函数接收的参数是一个函数名 2.返回值中包含函数 满足条件之一就是高阶函数 # 阅读全文
posted @ 2018-05-30 22:54 小飞侠Kobe 阅读(242) 评论(0) 推荐(0) 编辑