import linecache
the_line = linecache.getline(
‘d:/test.txt‘
, 1)
读取指定行
原文:https://www.cnblogs.com/crac/p/9173012.html