with open(infile, 'rb') as fin:
    dr = csv.DictReader(fin, delimiter='\t')
with open(outfile, 'wb') as fou:
    dw = csv.DictWriter(fou, delimiter='\t', fieldnames=dr.fieldnames)
headers = {}
for n in dw.fieldnames:
    headers[n] = n
dw.writerow(headers)
for row in dr:
    dw.writerow(row)
Writing header with DictWriter from Python's csv module