I am trying to write to a csv file via the following
file = open(\'P:\\test.csv\', \'a\')
fieldnames = (\'ItemID\', \'Factor\', \'FixedAmount\')
wr = csv.D
Solution is to specify the "lineterminator" parameter in the constructor:
file = open('P:\test.csv', 'w')
fields = ('ItemID', 'Factor', 'FixedAmount')
wr = csv.DictWriter(file, fieldnames=fields, lineterminator = '\n')
wr.writeheader()
wr.writerow({'ItemID':1, 'Factor': 2, 'FixedAmount':3})
file.close()