Why kivy finds the function?

have python 3 code that runs on windows 10
import kivy
from kivy.app import App

class IdeApp(App):
 def printer():
 return 'pechat'

IdeApp().run()

there is a code on kv (the name of the ide file.kv)
BoxLayout:
Label:
 id: hell
 text: 'hello'
Button:
 text: 'press me'
 on_press: hell.text = IdeApp.printer()

And he's pressing the button gives an error like this.
Traceback (most recent call last):
 File "ide.py", line 8, in <module>
IdeApp().run()
 File "C:\Python34\lib\site-packages\kivy\app.py", line 828, in run
runTouchApp()
 File "C:\Python34\lib\site-packages\kivy\base.py", line 487, in runTouchApp
EventLoop.window.mainloop()
 File "C:\Python34\lib\site-packages\kivy\core\window\window_sdl2.py", line 619, in mainloop
self._mainloop()
 File "C:\Python34\lib\site-packages\kivy\core\window\window_sdl2.py", line 362, in _mainloop
EventLoop.idle()
 File "C:\Python34\lib\site-packages\kivy\base.py", line 330, in idle
self.dispatch_input()
 File "C:\Python34\lib\site-packages\kivy\base.py", line 315, in dispatch_input
post_dispatch_input(*pop(0))
 File "C:\Python34\lib\site-packages\kivy\base.py", line 221, in post_dispatch_input
 listener.dispatch('on_motion', etype, me)
 File "kivy\_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (kivy\_event.c:7699)
 File "C:\Python34\lib\site-packages\kivy\core\window\__init__.py", line 1030, in on_motion
 self.dispatch('on_touch_down', me)
 File "kivy\_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (kivy\_event.c:7699)
 File "C:\Python34\lib\site-packages\kivy\core\window\__init__.py", line 1046, in on_touch_down
 if w.dispatch('on_touch_down', touch):
 File "kivy\_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (kivy\_event.c:7699)
 File "C:\Python34\lib\site-packages\kivy\uix\widget.py", line 432, in on_touch_down
 if child.dispatch('on_touch_down', touch):
 File "kivy\_event.pyx", line 718, in kivy._event.EventDispatcher.dispatch (kivy\_event.c:7699)
 File "C:\Python34\lib\site-packages\kivy\uix\behaviors\button.py", line 110, in on_touch_down
self.dispatch('on_press')
 File "kivy\_event.pyx", line 714, in kivy._event.EventDispatcher.dispatch (kivy\_event.c:7654)
 File "kivy\_event.pyx", line 1224, in kivy._event.EventObservers.dispatch (kivy\_event.c:13497)
 File "kivy\_event.pyx", line 1108, in kivy._event.EventObservers._dispatch (kivy\_event.c:12329)
 File "C:\Python34\lib\site-packages\kivy\lang.py", line 1557, in custom_callback
 exec(__kvlang__.co_value, idmap)
 File ".\ide.kv", line 7, in <module>
 on_press: hell.text = the Ide.printer()
 NameError: name 'Ide' is not defined</module></module>

Why?
July 2nd 19 at 17:14
1 answer
July 2nd 19 at 17:16
class IdeApp(App):
 def printer():
 return 'pechat'

IdeApp().run()

Does not start, Traceback:
NameError: name 'App' is not defined

class IdeApp():
 def printer():
 return 'pechat'

IdeApp().run()

How do you even start?
AttributeError: 'IdeApp' object has no attribute 'run'

Well, that's something zapotecorum...
class IdeApp():
 def printer():
 return 'pechat'

IdeApp()


Then you have:
on_press: hell.text = IdeApp.printer()
and Traceback:
on_press: hell.text = the Ide.printer()

P. S. Not special, but was curious )
You need to have the module kivy - Alex.Cronin commented on July 2nd 19 at 17:19

Find more questions by tags KivyPython