PySimpleGUI/Demo_Super_Simple_Form.py

18 lines
582 B
Python
Raw Normal View History

2018-08-06 03:17:42 +00:00
import PySimpleGUI as sg
form = sg.FlexForm('Simple data entry form') # begin with a blank form
2018-08-09 17:18:04 +00:00
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()]
]
2018-08-06 03:17:42 +00:00
2018-08-09 17:18:04 +00:00
button, values = form.LayoutAndRead(layout)
2018-08-06 03:17:42 +00:00
2018-08-09 17:18:04 +00:00
sg.MsgBox(button, values['name'], values['address'], values['phone'])
print(values)