質問編集履歴

1

コードを実行できるように修正。

2020/07/11 15:38

投稿

chokokorone333
chokokorone333

スコア32

test CHANGED
File without changes
test CHANGED
@@ -14,6 +14,20 @@
14
14
 
15
15
  ```Python
16
16
 
17
+ #coding:utf-8
18
+
19
+
20
+
21
+ import tkinter as tk
22
+
23
+ from tkinter import ttk
24
+
25
+
26
+
27
+ root = tk.Tk()
28
+
29
+
30
+
17
31
  x = 0.1
18
32
 
19
33
  y = 0.2
@@ -22,7 +36,7 @@
22
36
 
23
37
  for i in range(2):
24
38
 
25
- box = ttk.Combobox(self, state="A","B"])
39
+ box = ttk.Combobox(root, values=["A","B"])
26
40
 
27
41
  box.place(relx=0.1, rely=y-0.1)
28
42
 
@@ -37,6 +51,10 @@
37
51
  x += 0.1
38
52
 
39
53
  y += 0.1
54
+
55
+
56
+
57
+ root.mainloop()
40
58
 
41
59
  ```
42
60
 
@@ -56,21 +74,29 @@
56
74
 
57
75
  ```Python
58
76
 
77
+ import tkinter as tk
78
+
79
+ from tkinter import ttk
80
+
81
+
82
+
83
+ root = tk.Tk()
84
+
85
+
86
+
59
87
  x = 0.1
60
88
 
61
89
  y = 0.2
62
90
 
63
91
 
64
92
 
65
- box = ttk.Combobox(self, state="A","B"])
93
+ box = ttk.Combobox(root, values=["A","B"])
66
94
 
67
- box2 = ttk.Combobox(self, state="A","B"])
95
+ box2 = ttk.Combobox(root, values=["A","B"])
68
96
 
69
97
 
70
98
 
71
99
  box_array = [box, box2]
72
-
73
-
74
100
 
75
101
  for i in box_array:
76
102
 
@@ -85,6 +111,10 @@
85
111
  x += 0.1
86
112
 
87
113
  y += 0.1
114
+
115
+
116
+
117
+ root.mainloop()
88
118
 
89
119
 
90
120