import mh_python import pyPgSQL.PgSQL mh_python.initbrain() print "\033[2J" conn = pyPgSQL.PgSQL.connect("") cur = conn.cursor() cur.execute("SELECT message FROM omegle_messages") messages = cur.fetchall() c=0 for message in messages: c+=1 if c%20==0: print "%s%s/%s" % ("\033[2K\033[E",c,len(messages)), mh_python.learn(message[0]) print "" cur.close() conn.close() import sys while True: print ">>> ", x=sys.stdin.readline().strip() print "<<< %s " % mh_python.doreply(x)