On Jul 3, 8:56 am, Sebastian Wiesner <[EMAIL PROTECTED]> wrote: > [ Benjamin <[EMAIL PROTECTED]> ] > > > On Jul 2, 9:47 pm, Justin Ezequiel <[EMAIL PROTECTED]> > > > wrote: > > > On Jul 3, 9:40 am, Benjamin <[EMAIL PROTECTED]> wrote: > > > > How does one get the path to the file currently executing (not the > > > > cwd). Thank you > > > > os.path.dirname(sys.argv[0]) > > > The returns the file that was called first, but not the one currently > > executing... > > Use __file__ instead of sys.argv[0] So: if __name__ == "main": currentDir = os.path.dirname(sys.argv[0]) else: currentDir = os.path.dirname(__file__) > > -- > Freedom is always the freedom of dissenters. > (Rosa Luxemburg) > > signature.asc > 1KDownload
-- http://mail.python.org/mailman/listinfo/python-list