Aug-08-2018, 07:18 PM
(Aug-08-2018, 06:39 PM)Axel_Erfurt Wrote:(Aug-08-2018, 02:08 PM)PySimpleGUI Wrote: How does something like this look to you?that gives me an errorimport 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)PySimpleGUI was installed with pip
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'
Ah, the dictionary code only works with the current GitHub post. I have not yet released it to PyPI. The code is too new.
The easiest thing to do is to download the PySimpleGUI.py file from GitHub and put it in the same folder as your application.