[Pythonmac-SIG] Testing sqlite3 on python2.5 More

Samuel M. Smith smithsm at samuelsmith.org
Fri Mar 2 21:53:37 CET 2007


I was able to run the example from the python library docs for pysqlite3
I assume that means my sqlite3 installation is good?
I would appreciate confirmation from somebody who knows what they are  
doing.

thanks



$ python
Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import sqlite3
 >>> sqlite3.connect('/data/temp/example')
<sqlite3.Connection object at 0x156b0>
 >>> conn = sqlite3.connect('/data/temp/example')
 >>> curs = conn.cursor()
 >>> curs.execute('''create table stocks
... (date text, trans text, symbol text, qty real, price real)''')
<sqlite3.Cursor object at 0xd3a10>
 >>> curs.execute("""insert into stocks values  
('1006-01-05','buy','rhat',100,35.14)""")
<sqlite3.Cursor object at 0xd3a10>
 >>> curs.execute('select * from stocks order by price')
<sqlite3.Cursor object at 0xd3a10>
 >>> for row in curs:
...     print row
...
(u'1006-01-05', u'buy', u'rhat', 100.0, 35.140000000000001)
 >>>



More information about the Pythonmac-SIG mailing list