Jordan Greenberg schrieb:
> Slightly hackish and nasty, but seems to do the trick. Someone'll
> probably suggest a better way, this is just the first thing I could come
> up with:
No, IMHO it's perfectly normal and safe practice, though this gets the full
path name of the program. If you want the directory it is in, do this:
from os.path import abspath, dirname
import sys
app_dir = abspath(dirname(sys.argv[0]))
Of course you have to do this before you (or some other code in your program)
do anything siilar to os.chris('/somewhere/else').
Chris
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor