python 读资料

python 读文件http://www.cnblogs.com/xuxn/archive/2011/07/27/read-a-file-with-python.html# File: rea

python 读文件
http://www.cnblogs.com/xuxn/archive/2011/07/27/read-a-file-with-python.html



# File: readline-example-3.py

file = open("sample.txt")

while 1:
    lines = file.readlines(100000)
    if not lines:
        break
    for line in lines:
        pass # do something