Skip to content

Commit

Permalink
write reports out to csv
Browse files Browse the repository at this point in the history
  • Loading branch information
jessykate committed Mar 7, 2010
1 parent 26b26ae commit cb51a5f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions agency_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def report(agency):
sep = '\t'
stats = report(agency)
rows = zip(stats['timestamps'], stats['ideas'], stats['votes'], stats['comments'])
print "%s%s%s%s%s%s%s" % ('Time', sep, 'Ideas', sep,'Votes', sep, 'Comments')
report = open(agency+'.csv', 'w')
report.write("%s%s%s%s%s%s%s\n" % ('Time', sep, 'Ideas', sep,'Votes', sep, 'Comments'))
for row in rows:
print "%s%s%d%s%d%s%d" % (row[0], sep, row[1], sep, row[2], sep, row[3])
report.write("%s%s%d%s%d%s%d\n" % (row[0], sep, row[1], sep, row[2], sep, row[3]))

0 comments on commit cb51a5f

Please sign in to comment.