Use csv.writer().writerows() rather than explicitly looping through with writerow()

This commit is contained in:
Klaus-Uwe Mitterer 2015-04-24 23:05:39 +02:00
parent f83c69f902
commit 6a1cce1b97

View file

@ -74,8 +74,7 @@ def getTweetsByDate(strings = [], path = tools.config.dbpath, fr = "", to = ""):
tweets = db.executeQuery(queryBuilder(strings,fr,to))
writer = csv.writer(sys.stdout)
for day in tweets:
writer.writerow(day)
writer.writerows(tweets)
if __name__ == "__main__":
strings, fr, to = dateArgs()