On 13/10/2011 08:10 ص, Gadget/Steve wrote:
Presumably you can run it if you cd to c:\trunk\Project first.
Actually i can't run the project from c:\trunk\Project in both cases
by IDE or from batch file :-(
Your batch file is wrong in that %CD% will add the
current directory, c:\trunk to the path NOT c:\trunk\MyProject as
can be seen from the log.
Actually I realy want to run the project from c:\trunk because I
sucessfully run it from same path in IDE.
You can either add to the path with an explicit line,
that will allow you to run from anywhere but require that your
code always lives in the same place and always be run from the
batch file. Better would be to add near the beginning of main.py
something like the following:
import sys
from os.path import split, join, abspath
main = abspath(sys.arg[0]) # get the path for main
(maindir, main0 = split(main) # split it
sys.path.insert(0, maindir) # add the main directory to the
beginning of the path.
I got:
AttributeError: 'module' object has no attribute 'arg'
|
_______________________________________________
Eric mailing list
[email protected]
http://www.riverbankcomputing.com/mailman/listinfo/eric