I got a question about redirect the screen output into a single file. Here is my code to print the screen output:
for O,x,y,z,M,n in coordinate:
print(O,x,y,z,M,n)
And the screen output looks like:
O 0 0 0 ! 1
O 1 0 0 ! 2
O 2 0 0 ! 3
So how can I redirect all the data into a single file and in the same format, just like the screen output. Because it will be mush faster to get all the data rather than waiting for the screen output to finish.
I triedfor point in coordinate:
file.write(' '.join(str(s) for s in point))
but output file became:
O 0 0 0 ! 0O 1 0 0 ! 1O 2 0 0 ! 2O 3 0 0 ! 3O 4 0 0 ! 4O 5 0 0 ! 5O 6 0 0 ! 6O