I have a simple a Kivy interface that also uses the terminal.
Example code:
JavaScript
x
13
13
1
import kivy
2
3
kivy.require('1.0.6')
4
5
from kivy.app import App
6
from kivy.uix.label import Label
7
8
class MyApp(App):
9
def build(self):
10
return Label(text = 'Hello')
11
12
MyApp().run()
13
The problem is that whenever I start the script I get this:
JavaScript
1
24
24
1
[INFO ] [Logger ] Record log in C:UsersSimon.kivylogskivy_18-05-12_37.txt
2
[INFO ] [Kivy ] v1.10.0
3
[INFO ] [Python ] v3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)]
4
[INFO ] [Factory ] 194 symbols loaded
5
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
6
[INFO ] [Text ] Provider: sdl2
7
[INFO ] [OSC ] using <thread> for socket
8
[INFO ] [Window ] Provider: sdl2
9
[INFO ] [GL ] Using the "OpenGL" graphics system
10
[INFO ] [GL ] GLEW initialization succeeded
11
[INFO ] [GL ] Backend used <glew>
12
[INFO ] [GL ] OpenGL version <b'4.5.13467 Compatibility Profile Context 21.19.414.1280'>
13
[INFO ] [GL ] OpenGL vendor <b'ATI Technologies Inc.'>
14
[INFO ] [GL ] OpenGL renderer <b'AMD Radeon R7 Graphics'>
15
[INFO ] [GL ] OpenGL parsed version: 4, 5
16
[INFO ] [GL ] Shading version <b'4.50'>
17
[INFO ] [GL ] Texture max size <16384>
18
[INFO ] [GL ] Texture max units <32>
19
[INFO ] [Window ] auto add sdl2 input provider
20
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
21
[INFO ] [Base ] Start application main loop
22
[INFO ] [GL ] NPOT texture support is available
23
[INFO ] [Base ] Leaving application in progress
24
I have found that this is Kivy’s automatic debugging messages. How do I prevent them (or at least hide so that I can use the terminal)?
Advertisement
Answer
As shown in the docs, you should only do the following:
JavaScript
1
6
1
import os
2
os.environ["KIVY_NO_CONSOLELOG"] = "1"
3
4
import kivy
5
6