Lines Matching refs:fieldnames
168 .. class:: DictReader(csvfile, fieldnames=None, restkey=None, restval=None, \
173 *fieldnames* parameter. The *fieldnames* parameter is a :ref:`sequence
176 resulting dictionary. If the *fieldnames* parameter is omitted, the values
177 in the first row of the *csvfile* will be used as the fieldnames. If the
178 row read has more fields than the fieldnames sequence, the remaining data is
180 fewer fields than the fieldnames sequence, the remaining keys take the value
197 .. class:: DictWriter(csvfile, fieldnames, restval='', extrasaction='raise', \
201 onto output rows. The *fieldnames* parameter is a :ref:`sequence
205 value to be written if the dictionary is missing a key in *fieldnames*. If
207 found in *fieldnames*, the optional *extrasaction* parameter indicates what
213 Note that unlike the :class:`DictReader` class, the *fieldnames* parameter
223 fieldnames = ['first_name', 'last_name']
224 writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
427 .. attribute:: csvreader.fieldnames
442 mapping fieldnames to strings or numbers (by passing them through :func:`str`