write numbers to a file

file = open("newfile.txt", "w")

for x in range(0, 10):
file.write("%d" % (x))
file.write("\n")

file.close()

Last modified: Tuesday, 6 May 2014, 1:37 PM