Hi, I'm wanting my program to loop and create different files outputting at different stages in a while loop, I just can't work out how to make it happen!
here's a stupid example
while (a<10):
a = a+1
if (a=4) or (a=6):
output = open('output'+a, 'w') #something like this?
output.write('%s' % (a))
output.close()
in other words i want the value of a to also be in the title of a new file that is opened, for example it would be output4.dat, output6.dat. I'm sure this should be possible in python.