PyDocs

File and Directory Access

linecache

Cache lines from Python source files.

This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
that name.
Symbols in linecache

c

checkcache
Discard cache entries that are out of date.
clearcache
Clear the cache entirely.

g

getline
Get a line for a Python source file from the cache.

l

lazycache
Seed the cache for filename with module_globals.