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

Keith Dart ♂ keith at dartworks.biz
Thu Dec 13 06:01:56 CET 2007


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?



-- 
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Keith Dart <keith at dartworks.biz>
   public key: ID: 19017044
   <http://www.dartworks.biz/>
   =====================================================================



More information about the Baypiggies mailing list