#!/usr/bin/python

# custom_dialect.py

import csv

csv.register_dialect("hashes", delimiter="#")

f = open('items3.csv', 'w')

with f:

    writer = csv.writer(f, dialect="hashes")
    writer.writerow(("pencils", 2)) 
    writer.writerow(("plates", 1))
    writer.writerow(("books", 4))

[((52, 97), 'csv.register_dialect', 'csv.register_dialect', (['"""hashes"""'], {'delimiter': '"""#"""'}), "('hashes', delimiter='#')\n", (72, 97), False, 'import csv\n'), ((150, 181), 'csv.writer', 'csv.writer', (['f'], {'dialect': '"""hashes"""'}), "(f, dialect='hashes')\n", (160, 181), False, 'import csv\n')]