text output
Dear all,
I'm using the script below in order to move a ball around the screen and save data to two text files. The first records keyboard and time responses, the second records x,y,z of the ball across time. Whilst the keyboard responses are recording to text fine and the x,y,z data is visible in the output screen of vizard, only the last x,y,z co-ord is saving to the text file. Is there a simple command I'm missing, or is the issue because I'm trying to write two files at once? I would be grateful for some help on this. Thank you. Jac Code:
####code for recording the data. |
You are opening the file during every iteration of your timer, this is very inefficient. Also, whenever you open a file in write mode (i.e. 'w') it will overwrite the current contents of the file. What you should do is open the file once, and just write to it inside your timer. Example:
Code:
logFile = open ('time.txt','w') |
That's great, thanks for your help.
Jac |
All times are GMT -7. The time now is 05:37 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC