上一页 1 ··· 53 54 55 56 57 58 59 60 61 ··· 70 下一页
摘要: 2、用python实现统计一篇英文文章内每个单词的出现频率,并返回出现频率最高的前10个单词及其出现次数,并解答以下问题?(标点符号可忽略) (1) 创建文件对象f后,解释f的readlines和xreadlines方法的区别? (2) 追加需求:引号内元素需要算作一个单词,如何实现? cat /r 阅读全文
posted @ 2018-06-01 16:30 littlevigra 阅读(1341) 评论(3) 推荐(0)
摘要: #!/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 阅读(225) 评论(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 阅读(263) 评论(1) 推荐(0)
摘要: join() 在调用结束前,主线程不会结束 不加的话,主线程会在子线程结束前继续执行(并行);加了join(),主线程会等待子线程结束后在继续执行下去(串行) #python3 #main print number ,stop after son thread stop #son thread pr 阅读全文
posted @ 2018-05-26 11:05 littlevigra 阅读(177) 评论(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 阅读(269) 评论(0) 推荐(0)
摘要: 所谓工厂函数就是指这些内建函数都是类对象(实际上是类), 当你调用它们时,实际上是创建了一个类实例。 type():查看类型 阅读全文
posted @ 2018-05-24 17:01 littlevigra 阅读(685) 评论(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 阅读(164) 评论(2) 推荐(0)
摘要: 异常信息的获取对于程序的调试非常重要,可以有助于快速定位有错误程序语句的位置。 这里获取异常(Exception)信息采用try...except...程序结构。如下所示: Python中获取异常(Exception)信息 - klchang - 博客园https://www.cnblogs.com 阅读全文
posted @ 2018-05-22 00:07 littlevigra 阅读(8728) 评论(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 阅读(569) 评论(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 阅读(303) 评论(0) 推荐(0)
上一页 1 ··· 53 54 55 56 57 58 59 60 61 ··· 70 下一页