Skip to content

[Addressed]Displaying records from a MySQL db to sg.Table() #1048

@OndoyManing

Description

@OndoyManing

Is this possible with PySimpleGUI? If yes, how is it properly done?
I tried

mycursor.execute("SELECT * FROM thesisdb.users")

rec = mycursor.fetchall()
                         
usersTab = [[sg.Button(key='Add User', button_color=sg.TRANSPARENT_BUTTON, border_width=0, image_filename='Buttons/Add.png')],
                    [sg.Table(values=rec)]]
logsTab = [[sg.T('Test Logs')]]

adminMainLayout = [[sg.TabGroup([[sg.Tab('Users', usersTab), sg.Tab('Logs', logsTab)]])]]

But it gives an error saying "TypeError: 'NoneType' object is not iterable"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions