都文件特定的行

import linecache spa

#thefiepath 文件路径 ci

#desired_line_number 整数,文件的特定行 get

theline = linecache.getline(thefilepath, desired_line_number)it

统计文件有一共有多少行console

count = len(open(thefilepath).readlines( )) import

相关文章
相关标签/搜索