Lines Matching refs:csvfile
56 .. function:: reader(csvfile, dialect='excel', **fmtparams)
58 Return a reader object which will iterate over lines in the given *csvfile*.
59 *csvfile* can be any object which supports the :term:`iterator` protocol and returns a
61 <file object>` and list objects are both suitable. If *csvfile* is a file object,
78 >>> with open('eggs.csv', newline='') as csvfile:
79 ... spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')
86 .. function:: writer(csvfile, dialect='excel', **fmtparams)
89 strings on the given file-like object. *csvfile* can be any object with a
90 :func:`write` method. If *csvfile* is a file object, it should be opened with
108 with open('eggs.csv', 'w', newline='') as csvfile:
109 spamwriter = csv.writer(csvfile, delimiter=' ',
179 >>> with open('names.csv', newline='') as csvfile:
180 ... reader = csv.DictReader(csvfile)
216 with open('names.csv', 'w', newline='') as csvfile:
218 writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
275 with open('example.csv', newline='') as csvfile:
276 dialect = csv.Sniffer().sniff(csvfile.read(1024))
277 csvfile.seek(0)
278 reader = csv.reader(csvfile, dialect)