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
Twenty quatloos says you're running under windows (well, a hundred, given that your file is called P:\test.csv). You're probably getting extra \rs.
P:\test.csv
\r
[edit]
Okay, since using binary mode causes other problems, how about this:
file = open('P:\test.csv', 'w', newline='')