Kivy Tutorials
About Lesson

In this Kivy Tutorial we are going to talk about Kivy Design Language,  Kivy provides a design language specifically geared towards easy and scalable GUI Design. The language makes it simple to separate the interface design from the application logic, also it is called KVlang.  It has very clean syntax and makes Kivy interface design much more enjoyable than any other toolkit.

 

All right now we need to create two files, the first one is with .kv extension and we add our KV code in this file, and the second one our PY file, and in the PY file we want to load our KV file.

 

 

Note: Your .kv file should always have the same name as your app class. it is one of the important point that will be confusing for those who are new with Kivy. but make sure when you create your .kv file, it should be the same as your main app class.  for example i have called my python app class Window, now i need to create a .kv file at name of window.kv, the same as my app class.

 

This is a very simple KV language file that creates a new Label object and sets its text to the Welcome to geekscoders.com string. If you now run the code , you will see the window pop up, still with a black background, but also with the text displayed in its center.

 

 

Now we need to create a Python file, iam going to call window.py, but you can call it what ever you want, and it returns just a label widget in Kivy.

 

 

 

Run the complete code and this will be the result.

Kivy Tutorial - Kivy Design Language
Kivy Tutorial – Kivy Design Language