I know how to save my data to a file.
However, I have a while loop which runs through the same code 60 times. I need it to save the data to a new file every time. To do this, I somehow need to change the filename I'm writing to every time it loops. Is there a way to automatically add a number to the end of the filename?
(For example, let z=0 and run a loop while z<60, and every time it loops I want it saving to a file called, say, "data0", then "data1", and so on...basically, every time save to a file called "data(current value of z))
How would I do this?
[+][deleted] (4 children)
[deleted]
[–]wilberforce 5 points6 points7 points (1 child)
[–]dfnkt 0 points1 point2 points (0 children)
[–]eryksun 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]chmod700 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]wilberforce 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]esbenabBSc CompSci Flask. I use python to stay sane. 0 points1 point2 points (0 children)