質問編集履歴
1
コードと内容の変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,9 +10,9 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
def button_click():
|
13
|
+
#def button_click():
|
14
14
|
|
15
|
-
show_selection()
|
15
|
+
# show_selection()
|
16
16
|
|
17
17
|
|
18
18
|
|
@@ -22,15 +22,23 @@
|
|
22
22
|
|
23
23
|
if i == 0:
|
24
24
|
|
25
|
-
|
25
|
+
one = sum(x)
|
26
26
|
|
27
|
-
|
27
|
+
zero = len(x) - sum(x)
|
28
28
|
|
29
|
-
if
|
29
|
+
if one > zero:
|
30
30
|
|
31
31
|
print("OK")
|
32
32
|
|
33
|
+
elif i == 1:
|
33
34
|
|
35
|
+
one = sum(x)
|
36
|
+
|
37
|
+
zero = len(x) - sum(x)
|
38
|
+
|
39
|
+
if one > zero:
|
40
|
+
|
41
|
+
print("BAD")
|
34
42
|
|
35
43
|
|
36
44
|
|
@@ -52,7 +60,7 @@
|
|
52
60
|
|
53
61
|
# Listbox
|
54
62
|
|
55
|
-
currencies = (
|
63
|
+
currencies = ("A", "B")
|
56
64
|
|
57
65
|
v1 = StringVar(value=currencies)
|
58
66
|
|
@@ -78,17 +86,17 @@
|
|
78
86
|
|
79
87
|
|
80
88
|
|
81
|
-
|
89
|
+
a = [0,0,0,0,1,1,1]
|
82
90
|
|
83
|
-
button1 = ttk.Button(frame1, text='OK', command=button_click)
|
84
|
-
|
85
|
-
b
|
91
|
+
b = [1,1,1,1,1,0,0]
|
86
92
|
|
87
93
|
|
88
94
|
|
89
|
-
|
95
|
+
#Button
|
90
96
|
|
97
|
+
button1 = ttk.Button(frame1, text='OK', command=lambda: show_selection(a))
|
98
|
+
|
91
|
-
b
|
99
|
+
button1.grid(row=1, column=0, columnspan=2)
|
92
100
|
|
93
101
|
|
94
102
|
|
@@ -98,14 +106,14 @@
|
|
98
106
|
|
99
107
|
|
100
108
|
|
101
|
-
|
109
|
+
リストボックスのAが選ばれた時には、リストaに対して0の数が多ければ「OK」と表示。
|
102
110
|
|
103
|
-
リストボックスの
|
111
|
+
リストボックスのBが選ばれた時には、リストbに対して1の数が多ければ「OK」と表示。
|
104
112
|
|
105
113
|
|
106
114
|
|
107
|
-
|
115
|
+
以上のように実行したいと考えています。
|
108
116
|
|
109
117
|
|
110
118
|
|
111
|
-
|
119
|
+
よろしくお願いいたします。
|