Kamilche wrote:
> 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)
Putting the sys.argv call in a main block would make it more
future-proof (for the day when your script becomes a library ;):
import os
pathname = os.path.normpath(os.path.dirname(__file__))
# application code goes here
if __name__ == '__main__':
import sys
pathname = os.path.normpath(os.path.dirname(sys.argv[0]))
Robert Brewer
MIS
Amor Ministries
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list