Python Forum
[PyGUI] Two issues in table created by PySimpleGUI
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGUI] Two issues in table created by PySimpleGUI
#9
(Oct-03-2023, 05:05 PM)deanhystad Wrote:
Quote:table_rows = result is not working. throwing error.
Guess you need to figure out why.

This is the code you had:
for result in results:
    table_rows.append(list(result))
This worked, but items kept getting added on to the table instead of the table being reset to show the new items.

This didn't work:
table_rows = result
I think result was a typo, and I meant "results".

But results is probably not what we want either, because results contains multiple result, and result needed to be converted to a list to work. So somehow you need to reset table_rows to be empty, then call your for loop to add on the new rows.
rt
As the result coming as tuple, I had to convert it to a list and it worked with comprehension.
Also the table I am taking the -TABLE- from the event and it is working as expected.
Reply


Messages In This Thread
RE: Two issues in table created by PySimpleGUI - by ranjansanyal2007 - Oct-03-2023, 05:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PySimpleGUI Try Except jamesaarr 1 2,048 Nov-18-2021, 02:02 PM
Last Post: jamesaarr

Forum Jump:

User Panel Messages

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