回答編集履歴

2

実行結果を追記

2017/11/17 09:39

投稿

can110
can110

スコア38233

test CHANGED
@@ -75,3 +75,67 @@
75
75
  break
76
76
 
77
77
  ```
78
+
79
+
80
+
81
+ 実行結果。Win10x64上。
82
+
83
+ ```
84
+
85
+ >python hoge.py
86
+
87
+ [INFO ] [Logger ] Record log in C:\Users\user.kivy\logs\kivy_17-11-17_29.txt
88
+
89
+ [INFO ] [Kivy ] v1.10.0
90
+
91
+ [INFO ] [Python ] v2.7.14 |Anaconda custom (64-bit)| (default, Nov 8 2017, 13:40:45) [MSC v.1500 64 bit (AMD64)]
92
+
93
+ [INFO ] [Factory ] 194 symbols loaded
94
+
95
+ [INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
96
+
97
+ [INFO ] [OSC ] using <thread> for socket
98
+
99
+ [INFO ] [Window ] Provider: sdl2
100
+
101
+ [INFO ] [GL ] Using the "OpenGL" graphics system
102
+
103
+ [INFO ] [GL ] GLEW initialization succeeded
104
+
105
+ [INFO ] [GL ] Backend used <glew>
106
+
107
+ [INFO ] [GL ] OpenGL version <4.0.0 - Build 10.18.10.4425>
108
+
109
+ [INFO ] [GL ] OpenGL vendor <Intel>
110
+
111
+ [INFO ] [GL ] OpenGL renderer <Intel(R) HD Graphics 4000>
112
+
113
+ [INFO ] [GL ] OpenGL parsed version: 4, 0
114
+
115
+ [INFO ] [GL ] Shading version <4.00 - Build 10.18.10.4425>
116
+
117
+ [INFO ] [GL ] Texture max size <16384>
118
+
119
+ [INFO ] [GL ] Texture max units <16>
120
+
121
+ [INFO ] [Window ] auto add sdl2 input provider
122
+
123
+ [INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
124
+
125
+ [INFO ] [Text ] Provider: sdl2
126
+
127
+ [INFO ] [Base ] Start application main loop
128
+
129
+ [INFO ] [GL ] NPOT texture support is available
130
+
131
+ [ERROR ] [Base ] No event listeners have been created
132
+
133
+ [ERROR ] [Base ] Application will leave
134
+
135
+ input 9 to exit:1
136
+
137
+ input 9 to exit:9
138
+
139
+ >
140
+
141
+ ```

1

検証コードを追加

2017/11/17 09:38

投稿

can110
can110

スコア38233

test CHANGED
@@ -9,3 +9,69 @@
9
9
  on_press: app.root_window.close()
10
10
 
11
11
  ```
12
+
13
+
14
+
15
+ 以下検証コードです。
16
+
17
+ ```
18
+
19
+ from kivy.lang import Builder
20
+
21
+ from kivy.app import App
22
+
23
+ from kivy.uix.boxlayout import BoxLayout
24
+
25
+
26
+
27
+ Builder.load_string("""
28
+
29
+ <MyApp>:
30
+
31
+ Button:
32
+
33
+ id: btn
34
+
35
+ font_size: 68
36
+
37
+ Button:
38
+
39
+ id: btnExit
40
+
41
+ text: "Exit"
42
+
43
+ on_press: app.root_window.close()
44
+
45
+ """)
46
+
47
+
48
+
49
+ class MyApp(App, BoxLayout):
50
+
51
+ def build(self):
52
+
53
+ self.ids.btn.text = 'by Python'
54
+
55
+ return self
56
+
57
+
58
+
59
+ if __name__ == "__main__":
60
+
61
+ bApp = False
62
+
63
+ while True:
64
+
65
+ if bApp is False:
66
+
67
+ MyApp().run()
68
+
69
+ bApp = True
70
+
71
+ else:
72
+
73
+ if input('input 9 to exit:') == 9:
74
+
75
+ break
76
+
77
+ ```