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
#25
(Aug-08-2018, 01:17 AM)jfong Wrote: It happens just two steps away from the form shows up. First, making a selection at the ComboBox. Second, click Submit button.
Does it happen when you run the demo program from the command line, or only when you import it?


This
python Demo_Recipes.py
produces the same result?


When I tried to duplicate the steps on my machine, I get no problems. I tried it on Raspberry Pi running 3.4 and didn't get an error either.

Quote:Python 3.6.2 |Anaconda, Inc.| (default, Sep 19 2017, 08:03:39) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import Demo_Recipes
>>> Demo_Recipes.Everything()
>>>

On unpacking return values.... I recommend not using any kind of "indexes". For example, unpack directly into the user's variables:

button, (name, address, phone) = form.LayoutAndRead(layout)
Or do the unpack in 2 steps:
button, values = form.LayoutAndRead(layout)
name, address, phone = values
I do not recommend keeping track of offsets like this:
button, values = form.LayoutAndRead(layout)

name = values[0]
address = values[1]
phone = values[2]
Reply


Messages In This Thread
RE: [PySimpleGUI] Tutorial - Name, Address, Phone GUI - by PySimpleGUI - Aug-08-2018, 01:42 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