From: da at ski.org (David Ascher)
Date: Wed, 21 Apr 1999 22:10:28 -0700 (Pacific Daylight Time)
Subject: Directory of current file
Message-ID: <Pine.WNT.4.05.9904212159220.191-100000@david.ski.org>
X-UID: 1131                                                  

Tip:  To find out the directory of the currently executing program, use:

import sys, os
if __name__ == '__main__':
    _thisDir = ''
else:
    _thisDir = os.path.split(sys.modules[__name__].__file__)[0]

(note that this is a relative path).

--david







