[Baypiggies] Can you get the filename which is being execfile()'d from within the file being execfiled?

William Deegan bdbaddog at gmail.com
Thu Dec 13 06:28:28 CET 2007


On Dec 12, 2007 9:01 PM, Keith Dart ♂ <keith at dartworks.biz> wrote:

> William Deegan wrote the following on 2007-12-12 at 16:10 PST:
> ===
> > If I execfile('abc.py')
> >
> > And abc.py calls function tellme().
> > Is there a global or a way to pass to tellme() the filename being
> > execfile()'d?
> >
> > Let me know if this is not clear.
>
> ===
>
> Are you new to Python? It's actually rare that you would have to use
> execfile. Can you use a module?


It's not my code.. It's badly written python code I need to reverse engineer
and replace.
:)
I'll create a sample and email tomorrow.

Thanks for all the suggestions. I've not had a chance to try them as yet,
but will tomorrow.

_Bill

>
>
>
>
> --
> -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   Keith Dart <keith at dartworks.biz>
>   public key: ID: 19017044
>   <http://www.dartworks.biz/>
>   =====================================================================
>
> _______________________________________________
> Baypiggies mailing list
> Baypiggies at python.org
> To change your subscription options or unsubscribe:
> http://mail.python.org/mailman/listinfo/baypiggies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/baypiggies/attachments/20071212/59df5991/attachment.htm 


More information about the Baypiggies mailing list