"Suzanne Peel" <[EMAIL PROTECTED]> wrote > However both suggestions will only give me that name of the 1st file > executed eg when I use execfile('EA_Owner.py') the name returned > when > the __file__ or sys.argv[0] is executed always EA_Owner.py .
You didn't mention you were doing wacky stuff like using execfile... That makes it a bit more challenging. Is there any reason why you need to use execfile rather than just importing the file? execfile acts as if another interpreter session was running so its quite tricky to find out the name of the file that the original interpreter was running. You might be able to do it by setting a global variable to the current __file__ before calling execfile... > The trace-back feature provides this - can I force an error of sorts > that > will not suspend programming but will report the file/module/script > that > it is running ??? (Probably a bit dramatic but I am at a loss..) Look at the traceback module. I think its possible but messy. It would be better if you can find a way to avoid using execfile. HTH, -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor