[Tutor] path

Sean 'Shaleh' Perry shalehperry@attbi.com
Thu, 28 Feb 2002 18:57:07 -0800 (PST)


On 01-Mar-2002 kirk Bailey wrote:
> ok, I want to have a program tell itself where it lives, so it can
> figure out path information.
> I want it to read a config file, but it has to know where it is, and
> use that to read the config file, so it knows where everything else
> is! 'pwd' in unix would work, and mabe a few other things, but I do
> not seem to stumble over what is needed to do this. when I tell it to
> just open the file 'foo.cf' it stumbles, as when it tries to open
> './foo.cf'! Clue eagerly saught, over.
> 

check out the os and os.path modules.  Lots of path handlers there.