I have a question about file output in Python. I was designing a software that reads values from 3 sensors. Each sensors read 100 values for 1 second, and between each process, I have to print them in file.
time_memory = [k + i/100 for i in range(100)] # dividing 1 second into 100 intervals
x = [100 elements]
y = [100 elements]
z = [100 elements]
Below is the code of writing into the file.
for i in range(self.samples):
self.time_memory[i] = file_time + self.time_index[i]
f.write("{0} {1} {2} {3}\n".format(self.time_memory[i], x[i], y[i], z[i]))
So the result in the file will look like
time_value, x, y, z
time_value, x, y, z
...
However, when the measurement time is over 8000 seconds, the software stops. I think it is due to so many data the device must proceed since the device I am using is kind of an old one. (I cannot change the device because the computer is connected to NI DAQ device.)
I tried to find many alternative ways to change the code above, but I couldn't find it. Is there anyone who can help me with this problem??