def a():
print __name__
Is there a chance I might have such a function, but print the "correct" module name if imported by another module and called from here?
"Fixed" the name of the module should always be the one from which it is called.
user975135
source
to share