On Mon, Aug 1, 2011 at 6:38 PM, happykid <psyking...@gmail.com> wrote: > I want to use this function to get the directory path of the running > script, but it always returns empty string. Can anyone help me solve > this? Thank you.
As long as you haven't changed directory since startup, you should be able to use os.path.abspath(sys.argv[0]) to get the absolute path name. It'll automatically fill in the path from the current directory if it's not provided. See: http://docs.python.org/py3k/library/os.path.html#os.path.abspath ChrisA -- http://mail.python.org/mailman/listinfo/python-list