I have sequence of numbers:
6577
I would like to see them in the .csv file like this:
6
5
7
I've tried with file writer but it writes all numbers in first row.
sequence is string..
s = ['6','5','7','7','6']
item_length = len(s)
with open('test.csv', 'wb') as test_file:
file_writer = csv.writer(test_file)
for i in range(item_length):
file_writer.writerow([x[i] for x in s])
python -c "for d in '6577':print d" > filesolves you problem.xlwtmodule in pythons = '657'is not the same as6577. Which is it? And if there's only one column, why do you need csv?