# csv_dictwriter.py
import csv
import sys

fieldnames = ('Title 1', 'Title 2', 'Title 3', 'Title 4')
headers = {n: n for n in fieldnames}
unicode_chars = 'å∫ç'

with open(sys.argv[1], 'wt', encoding='utf-8', newline='') as f:

    writer = csv.DictWriter(f, fieldnames=fieldnames)
    writer.writeheader()

    for i in range(3):
        writer.writerow({
            'Title 1': i + 1,
            'Title 2': chr(ord('a') + i),
            'Title 3': '08/{:02d}/07'.format(i + 1),
            'Title 4': unicode_chars[i],
        })

print(open(sys.argv[1], 'rt', encoding='utf-8', newline='').read())
# $ python csv_dictwriter.py testout.csv
