12.20.5 Examples

The ``Hello, world'' of csv reading is

import csv
reader = csv.reader(file("some.csv"))
for row in reader:
    print row

The corresponding simplest possible writing example is

import csv
writer = csv.writer(file("some.csv", "w"))
for row in someiterable:
    writer.writerow(row)

See About this document... for information on suggesting changes.