Visco Shaun wrote:

> Is there a way to know the name of the script(say A), which is importing
> a module(say B), from B?
> ie in above situation i should be able to get name 'A' through some way
> in B, when A contains an 'import B' statement.

While

import sys
print "I'm imported by %r" % sys._getframe(1).f_globals["__name__"]

will sometimes work this is a bad idea. What are you trying to achieve?
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to