RE: Help with embedding fully qualified script name

2005-02-14 Thread Robert Brewer
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

Re: Help with embedding fully qualified script name

2005-02-14 Thread Kamilche
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) -- http://mail.python.org/mailman/listinfo/p

Help with embedding fully qualified script name

2005-02-13 Thread Jim Wallace
I'm trying to call a method in a script file given a fully qualified file name, e.g. c:\myscript\test.py. I find that PyImport_Import("test") works fine, with c:\myscript is set as the first item in the PYTHONPATH. I tried PyRun_Simple and that does run my specific file, but then when I try to