Код:
from kivy.app import App
from kivy.uix.button import Button
class MyApp():
def build(self):
return Button()
if __name__ == '__main__':
MyApp().run()
Результат:
[INFO ] [Logger ] Record log in C:\Users\Студия\.kivy\logs\kivy_19-11-10_6.txt
[INFO ] [deps ] Successfully imported "kivy_deps.gstreamer" 0.1.17
[INFO ] [deps ] Successfully imported "kivy_deps.glew" 0.1.12
[INFO ] [deps ] Successfully imported "kivy_deps.sdl2" 0.1.22
[INFO ] [Kivy ] v1.11.1
[INFO ] [Kivy ] Installed at "C:\Users\Студия\AppData\Local\Programs\Python\Python37-32\lib\site-packages\kivy\__init__.py"
[INFO ] [Python ] v3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)]
[INFO ] [Python ] Interpreter at "C:\Users\Студия\AppData\Local\Programs\Python\Python37-32\python.exe"
[INFO ] [Logger ] Purge log fired. Analysing...
[INFO ] [Logger ] Purge finished!
[INFO ] [Factory ] 184 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2
Traceback (most recent call last):
File "C:\Users\Студия\Documents\python kivy\main.py", line 9, in <module>
MyApp().run()
AttributeError: 'MyApp' object has no attribute 'run'
[Finished in 1.6s with exit code 1]
[shell_cmd: python -u "C:\Users\Студия\Documents\python kivy\main.py"]
[dir: C:\Users\Студия\Documents\python kivy]
[path: C:\Program Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;;;;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\AMD\ATI.ACE\Core-Static;C:\Program Files\Brackets\command;C:\Users\Студия\AppData\Local\Programs\Python\Python37-32\Scripts\;C:\Users\Студия\AppData\Local\Programs\Python\Python37-32\]