-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlx_PySimpleGUI.py
More file actions
69 lines (50 loc) · 1.86 KB
/
Copy pathlx_PySimpleGUI.py
File metadata and controls
69 lines (50 loc) · 1.86 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import PySimpleGUI as sg
layout = [
[sg.Text('Enter a Number')],
[sg.Input()],
[sg.OK()]
]
event,(number,) = sg.Window('Enter a number example').Layout(layout).Read()
sg.Popup(event,number)
##############下拉选项框########################
layout = [
[sg.Text('请选择你的性别',auto_size_text=True)],
[sg.InputCombo(['男','女','保密'],auto_size_text=True)],
[sg.OK('确认',auto_size_button=True)]
]
with sg.FlexForm('信息录入',auto_size_text=True) as form:
button_name ,(gender,) = form.Layout(layout).Read()
sg.Popup(button_name,gender)
##############滑动条#############################
layout = [
[sg.Text('选择你一个你喜欢的程度',auto_size_text=True)],
[sg.Slider(range=(1,500),default_value = 200,orientation ='h')],
[sg.OK('确认',auto_size_button=True)]
]
with sg.FlexForm('请滑动',auto_size_text=True) as form:
button_name,(likelevel,) = form.Layout(layout).Read()
sg.Popup(button_name,likelevel)
############################按钮################
layout = [
[sg.Text('你的学历是',auto_size_text=True)],
[sg.Radio('高中',group_id=1)], #h 或者 v 表示水平或者垂直
[sg.Radio('本科',group_id=1)],
[sg.Radio('硕士',group_id=1)],
[sg.Radio('博士',group_id=1)],
[sg.OK('确认',auto_size_button=True)]
]
with sg.FlexForm('按钮',auto_size_text=True) as form:
button_name,level = form.Layout(layout).Read()
sg.Popup(button_name,level)
############################复选框####################
layout = [
[sg.Text('你的学历是',auto_size_text=True)],
[sg.Checkbox('游泳',default=True)], #h 或者 v 表示水平或者垂直
[sg.Checkbox('篮球')],
[sg.Checkbox('足球')],
[sg.Checkbox('羽毛球')],
[sg.OK('确认',auto_size_button=True)]
]
with sg.FlexForm('复选框',auto_size_text=True) as form:
button_name,choices = form.Layout(layout).Read()
sg.Popup(button_name,choices)