module and file locations

Egor Bolonev ebolonev at rol.ru
Fri Jul 4 03:08:33 EDT 2003


Hello, Stuart!
You wrote  on Thu, 03 Jul 2003 12:38:53 GMT:

 SG> I am writing a debugging a Tkinter program.

 SG> While debugging I want to run it by pressing F5.
 SG> When in use I want to run it by double-clicking (win2000)

 SG> The program reads and write to various files which I want to store in
 SG> the same directory (or a sub directory) of the main script.

 SG> My question is: How can my program where it lives so I can get the base
 SG> directory?
 SG> argv[0]  - will this work debugging if I just import the file?
 SG> There is some about finding where a module is.  This seems to return
 SG> readable text that would require parsing rather than just a file name

 SG> Thanks,

Try vars()

With best regards, Egor Bolonev.  E-mail: ebolonev at rol.ru [ru eo en]





More information about the Python-list mailing list