I want to learn Kivy

avatar

kivy.jpg

I really like Python. I like it because of its general-purpose nature and how easy it is for beginners to start programming with. Most importantly I like it because it helps with automating simple repetitive tasks and saves time. Before Steem I had zero knowledge of python. I was introduced to Python here on Steem and have used for Steem related tasks and tasks outside of Steem.

I am not a developer. I don't have time to fully commit to programming and do it on a daily basis. Although when I do, I find it an interesting and productive way of spending time. Moreover, end result almost always saves time. What I am really bad at is, keeping codes/scripts organized. Over the years I have spent on Steem I wrote many scripts for various purposes. Some I still use, some I don't. When I need a certain task done, finding the right script and the right version became a task of its own. When I need to revise code and reuse it for a new task, I find myself confused and not understanding which part was doing what. In the end, with enough time spend again I am usually able to figure out. But leads to rewriting everything from scratch instead of re-purposing the code.

Just like any average computer user, my preference is to have a graphical interface to execute the scripts. I decided to learn more about GUI libraries for python so I can make a GUI program that will help with executing all the different scripts.

First, I came across Tkinter. As I was learning more about it, I started seeing other GUI libraries mentioned. One of them was Kivy. As I learned more about Kivy I was convinced that is what I needed. So, what is Kivy?

Kivy is a python library for creating UIs. Unlike other libraries, Kivy is cross-platform and will work on most of the major operating systems. The beauty of Kivy is that it is designed with a mobile-first mindset. Right out of the box it comes with features that enable developers to create mobile UIs and recognize touch and multi-touch gestures. It makes it possible to create iOS and Android Apps with python. One can develop an App and easily deploy it on multiple platforms like Linux, Mac, Windows, iOS, and Android. I find this to be powerful. Otherwise, you need to know Java to make apps for Android, Swift for iOS, C# for Windows, etc.

I personally am not interested or have time to create complex Apps or games. I understand how time-consuming development can be and I simply don't have the skills for that either. But the ability to create simple and personalized Apps to automate daily tasks is a good skill to have for any non-programmer with a little knowledge of python. In that regard, just like python Kivy delivers.

One of the unique features of Kivy library is that it has a KV language that keeps layout and design in a separate kv file. While one can write Kivy Apps with pure python, Kivy gives an option of using kv syntax to keep the design separate from he logic of the code. Many compare KV and python code relationship to the one of CSS and Javascript. While both serve the same purpose and work well together, each takes care of two different aspects of the App.

KV language is not necessarily a programming language. It lets us declare our UI, widgets, text, buttons, etc in a structured way and assign style property values for each element. When named properly python file detects the kv file and unifies them together to display the UI we are creating.

Kivy is open source and free to use for personal or commercial purposes. Currently, I am reading a book Kivy Blueprint by Mark Vasilkov. It is only 282 pages and covers Kivy for various use cases like mobile apps, networking, and games. As it teaches Kivy, readers can follow along and create fully functional apps and games. More about the book next time. If you are familiar or had experience with Kivy please share some tips and tricks.



0
0
0.000
5 comments
avatar

Managed to create a window with buttons using Kivy, at a first go, but that is about it. My focus is mostly on Python right now. And when it comes to adding a GUI my first choice would be Kivy.

0
0
0.000
avatar

Yes focused approach is always better. I easily get distracted to other things and don’t finish what I started. At the same time experimenting with gui seems to be a fun way of learning python.

0
0
0.000
avatar

True, for some Python projects it seems more fun to add a GUI using Kivy. Now I have many source files open in Geany and run in a terminal. Can see an advantage in programming a GUI. Load config and data files from there, edit them and start automation processes. And it apparantly could then run on my Android phone too.

... I easily get distracted to other things and don’t finish what I started...

That is also a very well known state of being to me. 😁 There are so many awesome things to do. Python is great, oh look GODOT now supports 3D! Imagine creating an HTML5 game build on Steem with that. It compiles to WASM!

Now, what was I actually working on again? 🥴

0
0
0.000
avatar

Congratulations @geekgirl! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You received more than 9000 as payout for your posts. Your next target is to reach a total payout of 10000

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Vote for @Steemitboard as a witness to get one more award and increased upvotes!
0
0
0.000
avatar

dont know about Kivy, i will give it a shoot :) thanks

0
0
0.000