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
#26
You didn't get my point. You can't give meaningful variable name in unpack:

name, address, phone = values

unless you already knew which element each item in values represents, and you can get this information only through counting. Also this unpack statement may need to be modified each time the form was modified.

If values is a dictionary, you can write (suppose 'address' is a key):

print(values['address'])

No counting is required and no changes from now on.
Reply


Messages In This Thread
RE: [PySimpleGUI] Tutorial - Name, Address, Phone GUI - by jfong - Aug-08-2018, 11:12 AM

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