I’m not exactly new to python but wouldn’t I know it well and fully, but I’m completely new to Kivy. It’s just a small thing I’m doing just to start somewhere. I’m working in Visual Studio Code(VSC). Python version 3.10. The idea is: there are 5 buttons, each button has a name, when you click on a button, image(meme) should show up. Here is the full code, terminal, debugger and what is in command prompt:
code
code
Terminal
Terminal
Debugger
Debugger
Command Prompt
Command Prompt
Here is python itself and a folder "Projects"
C:UsersКириллAppDataRoamingMicrosoftWindowsStart MenuProgramsPython 3.10
enter image description here
Here is folder with virtual environment(App_EPQ) and a folder with code(App_code)
C:UsersКириллAppDataRoamingMicrosoftWindowsStart MenuProgramsPython 3.10Projects
enter image description here
Thanks in advance
Tried to rewrite the code but that didn’t work. Tried to find someone with a similar problem no luck there also. No idea what to do next and how to fix it so this is my last hope.
2
Answers
Your class has to inherit a layout as well as App:
Another way to do it would be to create a class that builds the app and returns the layout:
as shown here https://kivy.org/doc/stable/guide/lang.html#designing-with-the-kivy-language
Replace your line:
with:
That’s all.
build()
method have to return one widget, which in your case is BoxLayout instance.