realtime output and csv files

Tim Chase python.list at
Fri Feb 5 23:27:15 EST 2016

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.

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)
    # for row in data:
    #     w.writerow(data)


More information about the Python-list mailing list