最赞回答 / meShare
1:readlines的参数是字节数,不是行数2:不加参数,默认把文件读完,3:参数小于io.DEFAULT_BUFFER_SIZE,他读出字节数接近于io.DEFAULT_BUFFER_SIZE(8K的一个值)4:如果输入的值大于io.DEFAULT_BUFFER_SIZE,读出字节数,接近于io.DEFAULT_BUFFER_SIZE的倍数的字节数,
2015-06-22
a file object itself is a iter object.
so, we can just:
f = open(file_name)
line_count = 0
for x in f:
line_count += 1
so, we can just:
f = open(file_name)
line_count = 0
for x in f:
line_count += 1
2015-06-11
@mooc3r
请问,有没有ipython notebook的教程,一直不知道ipython notebook怎么用自动补全
请问,有没有ipython notebook的教程,一直不知道ipython notebook怎么用自动补全
2015-06-08