Python Forum

Full Version: .csv files
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
here is my code to write to and save .csv file

import csv


f = csv.writer(open("renny's file", "w"))

string = ("Today is the day the Zombies are coming")
f.writerow([string])
print string
rather cryptic file name
(Nov-07-2016, 11:09 PM)Blue Dog Wrote: [ -> ]
string = ("Today is the day the Zombies are coming")

If your intention is to have "string" be a tuple, you need more than one element.
>>> s = ("Today")
>>> s
'Today'
>>> s = ("Today", )
>>> s
('Today',)
just saving a csv file to the top zombie, name renny
Pages: 1 2