sys.argv not found

Man Vehicle Laboratory FenZhao at mit.edu
Wed Jul 18 15:59:08 CEST 2001


Hi all,

I'm writing a python program that uses VRUT (OpenGL application), but I
seem to lose the sys.argv list whenever I run VRUT.  For example,
vrut.go() starts VRUT.  I call it after I ask for sys.argv, but somehow
it begins to run and in the display window gives an AttributeError for
argv.

I'm not quite understanding the logic of the order python is doing (why
it would call the vrut command before the sys.argv).  I tried wrapping
the vrut.go in a function, and calling that function instead to no
avail- same problem.  Sending in the wrong number of arguments however
will generate an "IndexError: list index out of range".

                  --Fen Zhao


mode=string.atoi(sys.argv[1])
ARGFILE_stim=sys.argv[2]
ARGFILE_calib=sys.argv[3]
OUTFILE=sys.argv[4]
SUMFILE=sys.argv[5]
sidOutfile=sys.argv[6]
VECTION_DURATION=string.atoi(sys.argv[7])
path=sys.argv[8]
...

vrut.go(vrut.NICE)




More information about the Python-list mailing list