Processing CSV files with csv.DictReader is great - but I have CSV files with comment lines in (indicated by a hash at the start of a line), for example:
# step s
Actually this works nicely with filter:
filter
import csv fp = open('samples.csv') rdr = csv.DictReader(filter(lambda row: row[0]!='#', fp)) for row in rdr: print(row) fp.close()