forked from PySimpleGUI/PySimpleGUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWeb_Simple.py
More file actions
28 lines (24 loc) · 682 Bytes
/
Web_Simple.py
File metadata and controls
28 lines (24 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import PySimpleGUIWeb as sg
# Basic example of PSGWeb
def main():
layout = [
[sg.Text('This is a text element')],
[sg.Input()],
[sg.Combo(['Combo 1'])],
[sg.Text('If you close the browser tab, the app will exit gracefully')],
[sg.InputText('Source')],
[sg.InputText('Dest')],
[sg.Ok(), sg.Cancel()]
]
window = sg.Window('Demo window..', layout)
i = 0
while True:
event, values = window.read(timeout=1)
if event != sg.TIMEOUT_KEY:
print(event, values)
if event is None:
break
i += 1
window.close()
main()
print('Program terminating normally')