Platform-independent way to refer to execute path

MK MK at foo.com
Wed Jun 25 11:11:34 EDT 2003


What would be the best platform-independent way to refer
to the current (execute) path for a Python script?

        self.dirname = ???

This variable should contain directory name for the current path.
It should work on every platform (Linux, Windows...). I'm
not interested in parsing this string. That is, simple

        f.write(self.dirname)

should work, withour ever peeking into the string. Thx,






More information about the Python-list mailing list