python计算文件的行数和读取指定行的内容

小文件读取,计算行数 1. count = len(open(filepath,'rU').readlines()) 大文件读取,计算行数 2. count = -1    for count, line in enumerate(open(thefilepath, 'rU')):        pass    count += 1 3. count = 0    thefile = open(t
相关文章
相关标签/搜索