Lines Matching refs:csvfile
60 .. function:: reader(csvfile, dialect='excel', **fmtparams)
62 Return a reader object which will iterate over lines in the given *csvfile*.
63 *csvfile* can be any object which supports the :term:`iterator` protocol and returns a
65 objects are both suitable. If *csvfile* is a file object, it must be opened
81 >>> with open('eggs.csv', 'rb') as csvfile:
82 ... spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')
98 .. function:: writer(csvfile, dialect='excel', **fmtparams)
101 strings on the given file-like object. *csvfile* can be any object with a
102 :func:`write` method. If *csvfile* is a file object, it must be opened with the
121 with open('eggs.csv', 'wb') as csvfile:
122 spamwriter = csv.writer(csvfile, delimiter=' ',
187 >>> with open('names.csv') as csvfile:
188 ... reader = csv.DictReader(csvfile)
222 with open('names.csv', 'w') as csvfile:
224 writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
272 with open('example.csv', 'rb') as csvfile:
273 dialect = csv.Sniffer().sniff(csvfile.read(1024))
274 csvfile.seek(0)
275 reader = csv.reader(csvfile, dialect)