def findsource(obj):
"""Return the entire source file and starting line number for an object.
The argument may be a module, class, method, function, traceback, frame,
or code object. The source code is returned as a list of all the lines
in the file and the line number indexes a line in that list. An IOError
is raised if the source code cannot be retrieved."""
filename = inspect.getsourcefile(obj)
if filename:
linecache.checkcache(filename)
return inspect.findsource(obj)
评论列表
文章目录