Python Forum
[PySimpleGUI] Tutorial - Name, Address, Phone GUI
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PySimpleGUI] Tutorial - Name, Address, Phone GUI
#22
I had noticed an error prone problem in the SG design. The SG use list as the eturned "values" which can only be accessed by the index. This makes it hard to figure out which item in the list belongs to which element on the form, and makes it worse when form's layout was modified later.

Dictionary might be better than list for this purpose where item can be accessed through the key. The problem now becomes where is the key comes from?

Maybe a "name" option is the answer. Each kind of elements which will be collected into the "values" should have a "name" option. This name was used as the key. If user forget to set it (default is None), this element will be excluded from the "values" and causes an exception when accessed. User can easily notice this error and correct it during testing.
Reply


Messages In This Thread
RE: [PySimpleGUI] Tutorial - Name, Address, Phone GUI - by jfong - Aug-07-2018, 10:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PySimpleGUI Try Except jamesaarr 1 2,007 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