This commit is contained in:
Jeremy Fincher 2004-02-08 03:34:08 +00:00
parent 36c6aa2d3d
commit e1f3393015

View File

@ -32,6 +32,7 @@
__revision__ = "$Id$" __revision__ = "$Id$"
import os import os
import csv
import sys import sys
if len(sys.argv) <= 1: if len(sys.argv) <= 1:
@ -78,9 +79,11 @@ if __name__ == '__main__':
cursor = db.cursor() cursor = db.cursor()
cursor.execute("""SELECT word_stats.user_id, words.word, cursor.execute("""SELECT word_stats.user_id, words.word,
word_stats.count word_stats.count
FROM word_stats, words""") FROM word_stats, words
WHERE word_stats.word_id = words.id""")
d = {} d = {}
for (id, word, count) in cursor.fetchall(): for (id, word, count) in cursor.fetchall():
#print word, count
d.setdefault(id, {})[word] = count d.setdefault(id, {})[word] = count
for (id, d) in d.items(): for (id, d) in d.items():
L = [channel, id] L = [channel, id]