So I was following this guy's video on Kivy Tutorial, and I'm extremely new to python and the kivy stuff. But when I copy the exact same line of codes:
main kivy.py
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.lang import Builder
Builder.load_file("thelab.kv")
class MainWidget(Widget):
pass
class thelabApp(App):
pass
thelabApp().run()
thelab.kv
MainWidget:
<MainWidget>:
Button:
text: 'Hello'
size: "400dp", "200dp"
pos: "100dp", "200dp"
all that shows up is a black screen. There's seems to be no problem with the installation of kivy. And no error messages. What do I do?
Okay! So, I solved it. I put the .kv
file in a different folder, and when I move it to the same one, it seems to work. I (also) might have forgotten to save the .kv
file?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.