Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #102571
| From | Tim Chase <python.list@tim.thechases.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: realtime output and csv files |
| Date | 2016-02-05 22:27 -0600 |
| Message-ID | <mailman.29.1454732997.2317.python-list@python.org> (permalink) |
| References | <n92ucb$1h5s$1@gioia.aioe.org> <56B4FEAC.4080706@gmail.com> |
On 2016-02-05 17:57, Bernardo Sulzbach wrote:
> CSVs is essentially text separated by commas, so you likely do not
> need any library to write it "Just separating with ','" should work
> if you are formatting them correctly.
> https://mail.python.org/mailman/listinfo/python-list
And even if you have things to escape or format correctly, the stdlib
has a "csv" module that makes this trivially easy:
data = [
(1, 3.14, "hello"),
(2, 1.41, "goodbye"),
]
from csv import writer
with open("out.csv", "wb") as f:
w = writer(f)
w.writerows(data)
# for row in data:
# w.writerow(data)
-tkc
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
realtime output and csv files lucan <lucan@NNN.it> - 2016-02-05 20:49 +0100
Re: realtime output and csv files Bernardo Sulzbach <mafagafogigante@gmail.com> - 2016-02-05 17:57 -0200
Re: realtime output and csv files lucan <lucan@NNN.it> - 2016-02-05 22:09 +0100
Re: realtime output and csv files Bernardo Sulzbach <mafagafogigante@gmail.com> - 2016-02-05 19:13 -0200
Re: realtime output and csv files Joel Goldstick <joel.goldstick@gmail.com> - 2016-02-05 16:43 -0500
Re: realtime output and csv files Bernardo Sulzbach <mafagafogigante@gmail.com> - 2016-02-05 19:51 -0200
Re: realtime output and csv files lucan <lucan@NNN.it> - 2016-02-06 14:40 +0100
Re: realtime output and csv files Joel Goldstick <joel.goldstick@gmail.com> - 2016-02-05 17:12 -0500
Re: realtime output and csv files Tim Chase <python.list@tim.thechases.com> - 2016-02-05 22:27 -0600
Re: realtime output and csv files Bernardo Sulzbach <mafagafogigante@gmail.com> - 2016-02-06 02:53 -0200
Re: realtime output and csv files Tim Chase <python.list@tim.thechases.com> - 2016-02-06 06:45 -0600
csiph-web