Skip to content

Commit 1c50159

Browse files
committed
提交代码
1 parent 81d67ee commit 1c50159

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

xianhuan/pysimplegui/demo.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
"""
4+
@author: 闲欢
5+
"""
6+
import PySimpleGUI as sg
7+
8+
layout = [
9+
[sg.Text('一句话概括Python')],
10+
[sg.Input(key='-INPUT111-')],
11+
[sg.Input(key='-INPUT222-')],
12+
[sg.Button('确认'), sg.Button('取消')],
13+
[sg.Text('输出:'), sg.Text(key='-OUTPUT-')]
14+
]
15+
window = sg.Window('PySimpleGUI Demo', layout)
16+
while True:
17+
event, values = window.read()
18+
print(event)
19+
print(values)
20+
if event in (None, '取消'):
21+
break
22+
else:
23+
window['-OUTPUT-'].update(values['-INPUT222-'])
24+
window.close()
25+

0 commit comments

Comments
 (0)