On Monday, March 14, 2011 5:53:25 AM UTC-4, Alain Ketterlin wrote:

> sys.path[0] is the path to the directory containing the script that the
> interpreter started with.

How about os.path.dirname(os.path.realpath(sys.argv[0]))? I think realpath is 
required in case someone runs it from a symlink. I don't know what can be done 
about Windows symlinks created with mklink. Thankfully that's uncommon.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to