import linecache spa
#thefiepath 文件路径 ci
#desired_line_number 整数,文件的特定行 get
theline = linecache.getline(thefilepath, desired_line_number)it
统计文件有一共有多少行console
count = len(open(thefilepath).readlines( )) import