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
#28
(Aug-08-2018, 02:08 PM)PySimpleGUI Wrote: How does something like this look to you?
import PySimpleGUI as sg

form = sg.FlexForm('Simple data entry form', use_dictionary=True)  # begin with a blank form

layout = [
          [sg.Text('Please enter your Name, Address, Phone')],
          [sg.Text('Name', size=(15, 1)), sg.InputText('1', key='name')],
          [sg.Text('Address', size=(15, 1)), sg.InputText('2', key='address')],
          [sg.Text('Phone', size=(15, 1)), sg.InputText('3', key='phone')],
          [sg.Submit(), sg.Cancel()]
         ]

button, values = form.LayoutAndRead(layout)

sg.MsgBox(button, values['name'], values['address'], values['phone'])

print(values)

that gives me an error

Output:
Exception ignored in: <bound method FlexForm.__del__ of <PySimpleGUI.PySimpleGUI.FlexForm object at 0x7f13b17620f0>> Traceback (most recent call last): File "/home/brian/.local/lib/python3.5/site-packages/PySimpleGUI/PySimpleGUI.py", line 985, in __del__ for row in self.Rows: AttributeError: 'FlexForm' object has no attribute 'Rows' Traceback (most recent call last): File "/tmp/tmp.py", line 10, in <module> form = sg.FlexForm('Simple data entry form', use_dictionary=True) # begin with a blank form TypeError: __init__() got an unexpected keyword argument 'use_dictionary'
PySimpleGUI was installed with pip
Reply


Messages In This Thread
RE: [PySimpleGUI] Tutorial - Name, Address, Phone GUI - by Axel_Erfurt - Aug-08-2018, 06:39 PM

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