1

I am currently using the code below to select certain information from an Sqlite3 database to give information back to the user. I am wondering if somebody could point me in the right direction to a library/function that can allow me to create an easy to read HTML report for the user rather than the standard terminal shown?

Kind regards.

connect = sqlite3.connect(sqlitedb)
with connect:
    cur = connect.cursor()
    cur.execute("""SELECT messages._id,messages.body, participants_info.number, participants_info.display_name, participants_info._id
        FROM messages
        INNER JOIN participants_info
        ON messages.participant_id = participants_info._id;""")
while True:

row = cur.fetchone()
if row == None:
    break
print (row)

1 Answer 1

1

i've never used it myself but, i know that pandas has a DataFrame.to_html method so what you can do is: import pandas as pd frame = pd.read_sql_query(your_query, sql_connection) frame.to_html() you can read this for specifics

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.