上一页 1 ··· 53 54 55 56 57 58 59 60 61 ··· 70 下一页
摘要: #!/usr/bin/python#5!+4!+3!+2!+1! #give 3 return 3*2*1def jiechen(n): N = map(lambda x:x+1,range(n)) f = reduce(lambda x,y:x*y,N) return f #give 5 retu 阅读全文
posted @ 2018-05-31 11:39 littlevigra 阅读(218) 评论(3) 推荐(0) 编辑
摘要: #python3 #product new data into the queue #comsume data from the queue from queue import Queue import time , threading class product_data(threading.Th 阅读全文
posted @ 2018-05-27 16:35 littlevigra 阅读(253) 评论(1) 推荐(0) 编辑
摘要: join() 在调用结束前,主线程不会结束 不加的话,主线程会在子线程结束前继续执行(并行);加了join(),主线程会等待子线程结束后在继续执行下去(串行) #python3 #main print number ,stop after son thread stop #son thread pr 阅读全文
posted @ 2018-05-26 11:05 littlevigra 阅读(168) 评论(1) 推荐(0) 编辑
摘要: 报错: com.cloud.exception.ResourceUnavailableException: Resource [DataCenter:1] is unreachable: Unable to apply dhcp entry on router at com.cloud.networ 阅读全文
posted @ 2018-05-24 17:46 littlevigra 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 所谓工厂函数就是指这些内建函数都是类对象(实际上是类), 当你调用它们时,实际上是创建了一个类实例。 type():查看类型 阅读全文
posted @ 2018-05-24 17:01 littlevigra 阅读(659) 评论(0) 推荐(0) 编辑
摘要: 1.rsync -avz 172.16.2.61:~/vs/program/elasticsearch-5.0.0 --exclude=elasticsearch-5.0.0/data/* ./ 从其他节点的机器拷贝elasticsearch目录并忽略data目录 2、备份后直接压缩写入磁盘 备份m 阅读全文
posted @ 2018-05-23 15:10 littlevigra 阅读(156) 评论(2) 推荐(0) 编辑
摘要: 异常信息的获取对于程序的调试非常重要,可以有助于快速定位有错误程序语句的位置。 这里获取异常(Exception)信息采用try...except...程序结构。如下所示: Python中获取异常(Exception)信息 - klchang - 博客园https://www.cnblogs.com 阅读全文
posted @ 2018-05-22 00:07 littlevigra 阅读(8708) 评论(1) 推荐(0) 编辑
摘要: 在分发配置文件的时候,我用命令ansible big_hosthub -m copy -a "src=/home/clouder/deploy-conf.xml dest=/home/clouder/deploy-conf.xml force=yes" 不起作用,配置文件还是原来的文件,即使使用了f 阅读全文
posted @ 2018-05-21 17:44 littlevigra 阅读(556) 评论(1) 推荐(0) 编辑
摘要: 在执行 pip install mysql-python时报错: _mysql.c:29:20: error: Python.h: No such file or directory 解决方法:yum install python-devel #yum install mysql-devel.x86 阅读全文
posted @ 2018-05-20 22:28 littlevigra 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 我们用open方法打开文件有时候会有一些问题,因为open打开文件只能写入str类型,而不会管字符串是什么编码方式。 示例: >>> fr = open('test.txt','a') >>> line1 = "我爱祖国" >>> fr.write(line1) 有编码不统一的时候,此时写入open 阅读全文
posted @ 2018-05-18 15:58 littlevigra 阅读(225) 评论(1) 推荐(0) 编辑
上一页 1 ··· 53 54 55 56 57 58 59 60 61 ··· 70 下一页