python word count
来源:互联网 发布:淘宝账号注销后会怎样 编辑:程序博客网 时间:2024/06/05 18:26
'''
Created on 2013-3-2
@author: Administrator
'''
infile = open('./data.txt');
lines = infile.read().split("\n");
line_count = len(lines);
word_count = 0;
char_count = 0;
for line in lines:
words = line.split();
word_count += len(words);
char_count += len(line);
print ("File has {0} lines, {1} words, {2} chars".format(
line_count, word_count, char_count));
Created on 2013-3-2
@author: Administrator
'''
infile = open('./data.txt');
lines = infile.read().split("\n");
line_count = len(lines);
word_count = 0;
char_count = 0;
for line in lines:
words = line.split();
word_count += len(words);
char_count += len(line);
print ("File has {0} lines, {1} words, {2} chars".format(
line_count, word_count, char_count));
- python word count
- Python Word Count
- [Python]用正则表达式进行word Count
- Word Count
- Python+Hadoop Streaming实现MapReduce(word count)
- Python+Hadoop Streaming实现MapReduce(word count)
- [Memo] restricted word count
- hadoop word count example
- Word Count on hadoop
- Word Count示例
- Spark word count 实例
- Scala 版 word count
- Spark-Word Count实例
- Spark---Word Count
- spark word count
- Word Count (Map Reduce)
- Word Count (Map Reduce)
- Python count()
- Content indexing in Django using Apache Tika
- Detours能截取哪些函数?
- Tips & Tricks on Development Tools
- 8个Python编程语言的变种
- Python开发者应该知道的7个开发库
- python word count
- 为什么我不会舍弃Python投奔Go语言
- 假如女人是一种编程语言
- Python高效编程技巧
- 用遍历解决某数学题的易语言
- Google GO与C#之间的TCP通信案例
- 简析Go与其他语言不同的类型
- 单独编译android framework模块出现的问题
- 请注释你那该死的代码!