I wish to write a simple text file with 6 lines in Python 2.7. I'm using this code:
import csv
export=open('./images2/test.tfw', "wb")
writer=csv.writer(export, delimiter=' ', quoting=csv.QUOTE_NONE)
writer.writerow('0.06')
writer.writerow('0.00')
writer.writerow('0.00')
writer.writerow('-0.06')
writer.writerow('-10.59')
writer.writerow('38.49')
export.close()
And I'm getting inside the file:
0 . 0 6
0 . 0 0
0 . 0 0
- 0 . 0 6
- 1 0 . 5 9
3 8 . 4 9
But I don't want spaces or anything else inside the numbers, I need simply this:
0.06
0.00
0.00
-0.06
-10.59
38.49
But when I try delimiter=''
or delimiter=None
, I get the error "delimiter must be set".
How can I write my numbers without delimiters? Maybe it is a very basic question but I can't find it in google. Thank you!