python大文件统计有多少行

num_col = 0;

with open('xxx/xxx.xxx','rb') as fi:

  while(fi.readline() !=''):

    num_col = num_col + 1;

猜你喜欢

转载自www.cnblogs.com/HITSZ/p/8875045.html