2018-09-27 20:24:09 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
import sys
|
2018-09-28 18:57:37 +00:00
|
|
|
if sys.version_info[0] >= 3:
|
2018-09-27 20:24:09 +00:00
|
|
|
import PySimpleGUI as sg
|
2018-09-28 18:57:37 +00:00
|
|
|
else:
|
|
|
|
import PySimpleGUI27 as sg
|
2018-08-06 03:17:42 +00:00
|
|
|
|
2018-09-24 22:01:00 +00:00
|
|
|
"""
|
|
|
|
Simple Form showing how to use keys on your input fields
|
|
|
|
"""
|
|
|
|
|
2018-08-09 17:18:04 +00:00
|
|
|
layout = [
|
2018-09-23 16:16:50 +00:00
|
|
|
[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-09-24 22:01:00 +00:00
|
|
|
]
|
2018-08-06 03:17:42 +00:00
|
|
|
|
2018-09-24 22:01:00 +00:00
|
|
|
window = sg.Window('Simple Data Entry Window').Layout(layout)
|
2018-10-15 20:07:23 +00:00
|
|
|
event, values = window.Read()
|
2018-08-06 03:17:42 +00:00
|
|
|
|
2018-10-15 20:07:23 +00:00
|
|
|
sg.Popup(event, values, values['name'], values['address'], values['phone'])
|