import sqlite3 if __name__ =='__main__': db_file='d:\\data.db' conn=sqlite3.connect(db_file) cur=conn.cursor() cur.execute('SELECT * FROM table1') records=cur.fetchall() for x in records: print x[0]+' '+x[1] #有多少列就打印多少个 conn.close()