inspect.getsourcefile()

inspect.getsourcefile(object)[source]

Return the filename that can be used to locate an object’s source. Return None if no way can be identified to get the source.