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
Could it be that you are opening the output file in append mode?
file = open('P:\test.csv', 'a') # ^
Instead of write mode? If you run the program several times, the output from every run will be in that file...