# The betting game.
# We are going to assume that we are given inputs that either propose
# a bet, take part of a bet, process a result.
# Determine winners and losers.

import sqlite3 as lite
import sys


try:
	con = lite.connect('bet.db')
	cur = con.cursor()
	print "From tmp: "
	cur.execute("SELECT * FROM tmp")
	rows = cur.fetchall()
	print rows
	print "From tmp2: "
	cur.execute("SELECT * FROM tmp2")
	rows = cur.fetchall()
	print rows
	print "From tmp3: "
	cur.execute("SELECT * FROM tmp3")
	rows = cur.fetchall()
	print rows
	print "From account: "
	cur.execute("SELECT * FROM account")
	rows = cur.fetchall()
	print rows
	con.commit()

except lite.Error, e:

    if con:
        con.rollback()

    print "Error %s:" % e.args[0]
    sys.exit(1)

finally:

    if con:
        con.close()
