sys.argv not found

Man Vehicle Laboratory FenZhao at mit.edu
Wed Jul 18 12:01:06 EDT 2001


I've tried putting a print statement right after I import sys.  I have the same
error as before:


     ******************************************************************************

     * WINVRUT 2.4a  Copyright 1995-2001  University of California, Santa
     Barbara *
     *                                    Massachusetts Institute of
     Technology   *
     ******************************************************************************

     VRUT  2.4a
     voicekey                        Voicekey 0.9
     serialthrustmaster              Serial thrustmaster 1.0
     avstu                           AvatarStudio 1.1
     Traceback (most recent call last):
       File "<string>", line 1, in ?
       File "N:\FenZhao\E3_sid_data\e3_sid_data2.py", line 61, in ?
         print sys.argv
     AttributeError: argv

The error I get from vrut is from my code looking at argv, not vrut (error
message w/out print statement:

Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "N:\FenZhao\E3_sid_data\e3_sid_data2.py", line 62, in ?
    mode=string.atoi(sys.argv[1])
AttributeError: argv

So whatever my first operation is dealing with sys.argv, there's an attribute
error with argv)

What confuses me is that this error is displayed in the VRUT window; VRUT opens
two windows, a display window that shows the 3D VR scene, and a text window that
will display print statements and error messages from python.  Logically, if
argv can't be found, an error message will end the program before vrut ever gets
started.

I've also tried importing vrut after looking at sys.argv in case vrut does
something funky in it's initialization/import.  Same problem.  Yet commenting
out the vrut.go() command, and the sys.argv is fine.

                                        --Fen

PS. I hope this helps:  all of my code up to the call to vrut (minus
comments)...  there's not much there, can't figure out what's making it work
improperly.  None of the modules that I wrote and imported do anything with sys


     import vrut
     import sid


     import string
     import math
     import time


     import speeds
     import e3_dataAn
     import sys

     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)



Steve Holden wrote:

>
> >
> First, can we assume you have included an "import sys" above the code you
> quote?
>
> You should:
>
> a) Make sure you incude the exact error traceback with postings like this,
> so we can see more nearly where the problem might be occurring; and
>
> b) Scatter "print" statements to give you confidence that your logic is
> indeed being executed as you expect, in the sequence you expect.
>
> I have an idea that vrut.go() might be looking at sys.argv itself, but there
> isn't really sufficient data to *know* quite what's going wrong. Your
> assumptions appear reasonable, but I think your code *is* being executed in
> the order you expect.
>
> Good luck
>  Steve
> --
> http://www.holdenweb.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20010718/a0469a35/attachment.html>


More information about the Python-list mailing list