
Test my function (it gives me blank HTML file): connFood = nnect(os.path.join(dataDir,"seinfeldFood. #result_new = cursor.execute("""SELECT * FROM Category""")įo = open(os.path.join(dataDir,"tableView.html"),"w") Results = cursor.execute(("""SELECT * FROM %s""")%(tableName))Ĭursor.execute("CREATE TABLE IF NOT EXISTS Category (name)")Ĭursor.execute("""INSERT INTO Category (name) VALUES (?)""",("Category",))Ĭursor.execute("""INSERT INTO Category (name) VALUES (?)""", (c,)) Prompt = "Select table name from: %s\n"%" ".join(tables) import webbrowserĬursor.execute("""SELECT tbl_name FROM sqlite_master WHERE type = 'table'""") Open up a new Python file and follow along. I write the following code try to add the contents of sqlite table into a HTML file but I got blank html file. If you want to do the other way around, converting Pandas data frames to HTML tables, then check this tutorial. Besides, the HTML table should 1) have a title the same as the table name and 2) should have a header as the column names for the table. I want to write a program so that users can choose one of the tables from "seinfeldFood.sqlite" and the contents of the table are presented in a HTML file.


I have a database named "seinfeldFood.sqlite" and it has 4 tables: "episodes", "foods", "foods_episodes", and "food_types".
