Re: [Tutor] finding directory of self

2011-03-29 Thread Alan Gauld
Rance Hall ran...@gmail.com wrote osname = os.name pathtocfg = os.path.dirname(sys.argv[0]) configfileloc = os.path.abspath(pathtocfg) os.chdir(configfileloc) to set the directory of all subsequent file lookups in a script. This is not the most user friendly thing to do. Some sys admins

[Tutor] finding directory of self

2011-03-28 Thread Rance Hall
I had been doing this under windows: import os import sys osname = os.name pathtocfg = os.path.dirname(sys.argv[0]) configfileloc = os.path.abspath(pathtocfg) os.chdir(configfileloc) to set the directory of all subsequent file lookups in a script. It worked underwindows because the shortcuts

Re: [Tutor] finding directory of self

2011-03-28 Thread Wayne Werner
On Mon, Mar 28, 2011 at 6:43 PM, Rance Hall ran...@gmail.com wrote: I had been doing this under windows: import os import sys osname = os.name pathtocfg = os.path.dirname(sys.argv[0]) configfileloc = os.path.abspath(pathtocfg) os.chdir(configfileloc) to set the directory of all