K
K
kirya00252017-06-14 14:45:30
Python
kirya0025, 2017-06-14 14:45:30

Why do I only compile py code when compiling kv and py files?

Good day. I ran into such a problem that is related to compiling the code into apk format. I tried to compile two files with codes in buildozer, one of which contained the py format and the other kv. I only compiled the file in the py format and when I started on android nothing is displayed for me, because all gadgets in the kv file. Can you please tell me how to add a file with the kv extension to the apk file? Here is the code from the file with the py extension:

from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.widget import Widget
from kivy.uix.button import Button
class Widgets(Widget):
    def __init__(self):
        super(Widgets, self).__init__()
 
    def btn_clk1(self):
        self.labe.text="ouu"
    def btn_clk2(self):
        self.lbl.text="ser"
class SimpleKivy(App):
    def build(self):
        return Widgets()
SimpleKivy().run()

And here is the code from the file with the kv extension:
<Widgets>:
    lbl: my_label
    labe: my_labels
    Button:
        size: 100,75
        pos: 0,0
        text: "1"
        color: 0,1,0,1
        font_size: 40
        on_press: root.btn_clk1()
    Button:
        id: 1
        size: 170,75
        pos: 100,0
        text: "2"
        color: 1,0,0,1
        font_size: 40
        on_press: root.btn_clk2()
    TextInput:
        id: my_label
        size: 300,300
        pos: 300,0
        text: ""
        color: 1,0,0,1
        font_size: 40
    TextInput:
        id: my_labels
        size: 300,300
        pos: 300,300
        text: ""
        color: 1,0,0,1
        font_size: 40

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question