Skip to content

Commit 6632ca7

Browse files
committed
Create PySimpleGUI example
1 parent 75e30c3 commit 6632ca7

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
'''
2+
Combining Gooey and PySimpleGUI
3+
'''
4+
5+
import sys
6+
from time import sleep
7+
from gooey import Gooey, GooeyParser
8+
import PySimpleGUI as sg
9+
10+
@Gooey(auto_start=True)
11+
def main():
12+
_ = GooeyParser().parse_args(sys.argv[1:])
13+
14+
print('Demo starting')
15+
16+
window=sg.Window('interactive demo',
17+
[ [sg.Text('Please pick source file')],
18+
[sg.InputText(key='InputFilename'), sg.FileBrowse()],
19+
[sg.Submit(), sg.Cancel()]])
20+
event, values = window.Read()
21+
window.close()
22+
23+
if event == 'Submit':
24+
print(f'Pretending to process file {values["InputFilename"]}')
25+
sleep(4)
26+
print('Done')
27+
28+
if __name__ == '__main__':
29+
main()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PySimpleGUI>=4.60.4

0 commit comments

Comments
 (0)