[Tutor] Referer file from import
Chad Crabtree
flaxeater at yahoo.com
Fri Jan 14 18:05:58 CET 2005
Ok I will investigate this. Thank you that is probably what I
needed.
I am trying to make a macro expander for python based on BOO's
facility
for this. I thought it was neat. In addition I think it would be
helpful to simulate adding keywords so that all these bloggers
talking
about proposed syntax could actually try it. But mostly I want to
implement the
with keyword
with g:
append(1)
append(2)
append('woah')
Kent Johnson wrote:
> You could use trackback.extract_stack() to get the current stack
> trace. If you inspect this from within the imported module you
could
> probably figure out who is importing you.
>
> Do you really want the module where the import was done (the place
> where the import statement is)? Or are you trying to find the file
> containing the imported module?
>
> Kent
>
> Isr Gish wrote:
>
>> Chad Crabtree wrote:
>> >Is there a way to know what the path of the file is that
imported
>> a >module? I've tried __file__ and playing with globals() but
I
>> can't
>> >seem >to crack this.
>> >
>
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo
More information about the Tutor
mailing list