摘要: 1打开文件模式按行读入数据(One Line at a Time)f = open(filename) while True: line = f.readline() if not line: break process(line)f.close()2标准输入输出模式cat samplefile.txt|python somescript.py|sort(1)read all the file to the input streamimport systext = sys.stdin.read()words = text.split()wordcount = len(wo... 阅读全文
posted @ 2012-02-03 17:39 请你记住我 阅读(141) 评论(0) 推荐(0)