linecache.getlines()

linecache.getlines(filename, module_globals=None)[source]

Get the lines for a file from the cache. Update the cache if it doesn’t contain an entry for this file already.