Python Forum

Full Version: Python, PySimpleGUI and SQLite3
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all,

Me again, back at it again with the python problems!

I'm trying to get my python to read and display data from a database file. Now I'm also using PySimpleGUI to make a nice tool to add to and view the data from the database. currently the issue is here:

            while True:
                layout3 = [[sg.T("Please select the entry you wish to view")],
                           [sg.Multiline(cur.execute('SELECT ID FROM entry_list'))]]
                window3 = sg.Window("View Entry", layout3, size = (500,400))
                event,values = window3.read()
For the record there isn't currently an option to choose the entry as I want to get something displayed before I break it down further.

Now the problem is it should say inside the multiline:
"1 29-07-2021 This is a test"

However it says the following:
<sqlite3.Cursor object at 0x0000025143ECC3B0>

Now this isn't an error as such, it's just missing a bit of code that tells it to populate the multiline with the data from the table!

I tried the cur.fetchall() command however that raised an error saying the cursor is not callable.

Thanks,
James