with open('testdata.txt', 'rb') as inf:
    with open('testdata2.txt', 'wb') as outf:
        csvreader = csv.DictReader(inf)
fieldnames = ['Node'] + csvreader.fieldnames
csvwriter = csv.DictWriter(outf, fieldnames)
csvwriter.writeheader()
for node, row in enumerate(csvreader, 1):
    csvwriter.writerow(dict(row, Node='node %s' % node))
how to Add New column in beginning of CSV file by Python