Is it possible to get the name of the file containing the class? The variable exporter
is a class in the below.
def main(exporter):
v = exporter
print v # <__main__.Vudu object at 0x106ea5210>
# The class is "Vudu" and the filename that contains that class
# is called vudu_exporter. How would I get "vudu_exporter" ?
Update: The following works to get the name of the script containing the class:
script_name = os.path.basename(inspect.getfile(v.__class__))