How to print contents of any database file
1 import sqlite3 as lite 2 import sys 3 4 def print_db_content(database_to_read): 5 conn = lite.connect(database_to_read); 6 cur = conn.cursor() 7 # http://stackoverflow.com/questions/305378/list-of-tables-db-schema-dump-etc-using-the-python-sqlite3-api 8 # Below query is equivalent to typing .tables in sqlite command line 9 query = "SELECT name from sqlite_master where type = 'table'" 10 tables_list = list(cur.execute(query)) 11 print tables_list 12 for item in tables_list: 13 ...