Papalagi Pakeha wrote: > I guess I could do it with a little help of os.path.realpath() for all > those cases where absolute or relative path was used. But how should I > approach it when it's invoked as plain 'blah.py' because its directory > name is in $PATH?
Use the value of __file__ rather than sys.argv[0] -- it contains the directory information. You may still need to normalize the value using various os.path functions. Jeffrey -- http://mail.python.org/mailman/listinfo/python-list