linecache,想读某行周围的哪行都可以

import linecache

x=linecache.getlines('filename')[linecount]

猜你喜欢

转载自scm002.iteye.com/blog/2263602