Help with embedding fully qualified script name

Kamilche klachemin at comcast.net
Mon Feb 14 09:06:49 EST 2005


To avoid pathname headaches, I've taken to including the following 3
lines at the top of every script that will be double-clicked:

import os, sys
pathname, scriptname = os.path.split(sys.argv[0])
pathname = os.path.abspath(pathname)
os.chdir(pathname)




More information about the Python-list mailing list