Re: knowing a file's own name

2004-11-29 Thread Scott Frankel
Thanks for the responses! I'd forgotten about using the sys module: import sys filename = sys.argv[0] Using "__file__" also works. Thanks Scott On Nov 29, 2004, at 9:37 AM, Scott Frankel wrote: I'm looking for a way to identify a filename remotely. Put differently, is there a way

Re: knowing a file's own name

2004-11-29 Thread Fredrik Lundh
Scott Frankel wrote: > I'm looking for a way to identify a filename remotely. Put differently, > is there a way a file can get its own name from its globals()? > > doit.py calls exec() on a second py script, tpairs.py, to obtain a dict of > the globals in > tpairs.py. How can I add the filenam