Re: [Tutor] finding directory of self

2011-03-29 Thread Alan Gauld
"Rance Hall" 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 require config file

Re: [Tutor] finding directory of self

2011-03-28 Thread Wayne Werner
On Mon, Mar 28, 2011 at 6:43 PM, Rance Hall 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 subsequent fi

[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 ha