2010-09-16 63 views

回答

3

你可以使用默认的包,sqlite3

In [1]: import sqlite3 

In [3]: conn = sqlite3.connect('test.db') 

In [4]: cur = conn.cursor() 

In [5]: cur.execute('select * from table1') 
Out[5]: <sqlite3.Cursor object at 0xa3142c0> 

In [6]: scipy.array(cur.fetchall()) 
Out[6]: 
array([[ 1., 2.], 
     [ 3., 4.]]) 
相关问题