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 have a "Start In"
directory listing.

I need something for Linux use that does not care about a symlink that
would be used to start the script.

The above code finds the directory the symlink is in.

I'm actually not suprised by this, it is what I expected, I just don't
understand how to fix it.

How can I do something similar to this, but find the "real" dir?
Perhaps one of the other sys.argv arguments?

Thanks for your help

Rance
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to