读取指定行

import linecache
the_line = linecache.getline('d:/test.txt', 1)
原文地址:https://www.cnblogs.com/crac/p/9173012.html