Added a couple of tests to the sandbox.

This commit is contained in:
Federico Di Gregorio 2006-09-01 06:49:05 +00:00
parent 526fd62386
commit be9822801f
2 changed files with 28 additions and 0 deletions

19
sandbox/gtk.py Normal file
View File

@ -0,0 +1,19 @@
import psycopg2
o = psycopg2.connect("dbname=test")
c = o.cursor()
def sql():
c.execute("SELECT 1.23 AS foo")
print 1, c.fetchone()
#print c.description
c.execute("SELECT 1.23::float AS foo")
print 2, c.fetchone()
#print c.description
print "BEFORE"
sql()
import gtk
print "AFTER"
sql()

9
sandbox/textfloat.py Normal file
View File

@ -0,0 +1,9 @@
import gtk
import psycopg2
o = psycopg2.connect("dbname=test")
c = o.cursor()
c.execute("SELECT 1.23::float AS foo")
x = c.fetchone()[0]
print x, type(x)