0

Enter into my sqlite databse and show all tables in it:

sqlite3 mytest.db
.tables

All tables in mytest.db can list,now wrap the .tables in

from sqlalchemy import create_engine
import pandas as pd
engine = create_engine('sqlite:///option.sqilte')
df = pd.read_sql('.tables',engine)

another try:

import pandas as pd
import sqlite3
con = sqlite3.connect("option.sqlite")
df = pd.read_sql_query(".tables", con)

Both of them can show tables ,how to fix them?

showkey
  • 479
  • 37
  • 122
  • 257
  • You have to write the full query like here https://stackoverflow.com/a/10746045 . There is also an additional link for pandas – Finn Aug 30 '21 at 10:12

0 Answers0