Aug-18-2018, 09:02 PM
Hi!
I'm brand new to python FYI.
I'm trying to create a text list with a changing variable on each line e.g.
Many thanks!
I'm brand new to python FYI.
I'm trying to create a text list with a changing variable on each line e.g.
Output:example001test001
example002test002
example003test003
...
So far, from searching online I've got as far as this:values = "example{}test{}" id = ["%.3d" % i for i in range(1, 100)] result = values.format(id, id) outputfile = "Z:\RESULT.csv" import csv with open(csvfile, "w") as output: writer = csv.writer(output, lineterminator='\n') for val in links: writer.writerow([result])The problem is when I run this it isn't exporting the variables one per line, it's showing the whole list on each line instead. Any ideas?
Many thanks!