<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
 
<br>I've tried putting a print statement right after I import sys. 
I have the same error as before:
<br> 
<blockquote>******************************************************************************
<br>* WINVRUT 2.4a  Copyright 1995-2001  University of California,
Santa Barbara *
<br>*                                   
Massachusetts Institute of Technology   *
<br>******************************************************************************
<p>VRUT  2.4a
<br>voicekey                       
Voicekey 0.9
<br>serialthrustmaster             
Serial thrustmaster 1.0
<br>avstu                          
AvatarStudio 1.1
<br>Traceback (most recent call last):
<br>  File "<string>", line 1, in ?
<br>  File "N:\FenZhao\E3_sid_data\e3_sid_data2.py", line 61, in ?
<br>    print sys.argv
<br>AttributeError: argv</blockquote>

<p><br>The error I get from vrut is from my code looking at argv, not vrut
(error message w/out print statement:
<p>Traceback (most recent call last):
<br>  File "<string>", line 1, in ?
<br>  File "N:\FenZhao\E3_sid_data\e3_sid_data2.py", line 62, in ?
<br>    mode=string.atoi(sys.argv[1])
<br>AttributeError: argv
<p>So whatever my first operation is dealing with sys.argv, there's an
attribute error with argv)
<p>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.
<p>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.
<p>                                       
--Fen
<p>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
<br> 
<blockquote>import vrut
<br>import sid
<br> 
<p>import string
<br>import math
<br>import time
<br> 
<p>import speeds
<br>import e3_dataAn
<br>import sys
<p>mode=string.atoi(sys.argv[1])
<br>ARGFILE_stim=sys.argv[2]
<br>ARGFILE_calib=sys.argv[3]
<br>OUTFILE=sys.argv[4]
<br>SUMFILE=sys.argv[5]
<br>sidOutfile=sys.argv[6]
<br>VECTION_DURATION=string.atoi(sys.argv[7])
<br>path=sys.argv[8]
<p>vrut.go(vrut.NICE)
<br> 
<br> </blockquote>

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