Python Forum
Python, PySimpleGUI and SQLite3
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python, PySimpleGUI and SQLite3
#1
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
while dad_has_cigs == True:
    happiness = True
    if dad_has_cigs == False:
    print("Dad come home!")
    happiness = not happiness
    break
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  doubt about python tkinter and sqlite3 LONDER 2 2,119 Aug-14-2021, 08:48 AM
Last Post: ibreeden
  Python Variables and Sqlite3 Database Staples200 1 3,093 May-25-2021, 02:40 AM
Last Post: Staples200
  how can a sqlite command like import be executed using sqlite3 (python) Larz60+ 1 2,587 Mar-08-2019, 01:17 AM
Last Post: Larz60+
  Does Python sqlite3 detect connection errors zatlas1 6 3,882 Jan-18-2019, 06:02 AM
Last Post: zatlas1
  Auto increment in Python Sqlite3 kingram 1 11,719 Sep-15-2017, 12:15 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020