"conn=" should return an error if the table does not exist. Note that both conn and c (cursor) are garbage collected when the function exits so return them if you want to use them elsewhere http://www.tutorialspoint.com/python/pyt...ctions.htm
To print the table structure use PRAGMA
To print the table structure use PRAGMA
import sqlite3 as sqlite table_name="C:/Users/me/librarydb/booksdb" con = sqlite.connect(table_name) cur = con.cursor() meta = cur.execute("PRAGMA table_info(%s)" % (table_name)) for r in meta: print(r)