How to Create a Custom Loading Animation in Python Kivy (With Code)

 

๐Ÿ“˜ Tutorial: How to Create a Custom Loading Animation in Python Kivy

Want to give your Kivy app a sleek, professional feel? A custom loading animation can be a perfect touch! In this tutorial, I’ll walk you through creating a simple and stylish loading animation using Python and Kivy.

๐Ÿš€ What You’ll Learn:

  • How to use Kivy's Animation class

  • Creating shapes and motion using Canvas

  • Making reusable and customizable loading widgets


๐Ÿงฐ Requirements:

Make sure you have Python and Kivy installed.

pip install kivy , numpy , math 



Python Kivy Loading Animation Code



from kivy.app import App 
from kivy.uix.label import Label 
from kivy.uix.widget import Widget 
from kivy.clock import Clock 
from kivy.graphics import  Rectangle,Line,Ellipse,Color,RoundedRectangle 
import math 
from kivy.animation import Animation 

class sample(Widget):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)

        self.count = 0 
        with self.canvas :
            Color(1,1,1)
            self.line = Line(rounded_rectangle = (300,300,50,20,20),width = 2)
        Clock.schedule_interval(self.update,1/30)

    def update(self,dt):
        x = math.sin(self.count)*60
        y = math.cos(self.count)*60

        self.line.rounded_rectangle = (300+x,300,50-y,20,20)
        self.count += 0.1

class myapp(App):
    def build(self):
        return sample()
    
if __name__ == "__main__":
    myapp().run()


 


  Python Kivy loading animation 
 Kivy animation tutorial 
 Python custom loading spinner 
 Kivy UI animation example 
 Python Kivy graphics tutorial 
 Kivy app loading screen 
 Python app loading animation 
 Kivy circular progress animation Build animated loader 
Kivy Python GUI loading animation

How to Create a Simple Calculator App Using Python – Beginner Tutorial with Code

 How to Create a Simple Calculator App Using Python – Beginner Tutorial with Code


Are you just starting out with Python and want to build something cool? In this tutorial, we’ll show you how to create a **simple calculator app using Python** that can perform addition, subtraction, multiplication, and division.


This Python calculator is perfect for beginners learning basic functions and input/output operations.


---


๐Ÿ”ง What You’ll Learn:

- Taking user input in Python

- Using if-else statements

- Building simple functions for each operation

- Creating a loop to keep the calculator running


---


๐Ÿง  Python Calculator App Code


Here’s the full code:


```python

def add(x, y):

    return x + y


def subtract(x, y):

    return x - y


def multiply(x, y):

    return x * y


def divide(x, y):

    if y == 0:

        return "Error! Division by zero."

    return x / y


while True:

    print("\nSelect Operation:")

    print("1. Add")

    print("2. Subtract")

    print("3. Multiply")

    print("4. Divide")

    print("5. Exit")


    choice = input("Enter choice (1-5): ")


    if choice == '5':

        print("Exiting calculator. Goodbye!")

        break


    num1 = float(input("Enter first number: "))

    num2 = float(input("Enter second number: "))


    if choice == '1':

        print("Result:", add(num1, num2))

    elif choice == '2':

        print("Result:", subtract(num1, num2))

    elif choice == '3':

        print("Result:", multiply(num1, num2))

    elif choice == '4':

        print("Result:", divide(num1, num2))

    else:

        print("Invalid input. Please choose between 1-5.")


๐Ÿ–ฅ️ Output Example:


Select Operation:

1. Add

2. Subtract

3. Multiply

4. Divide

5. Exit

Enter choice (1-5): 1

Enter first number: 10

Enter second number: 5

Result: 15.0


๐Ÿ“Œ Tips to Improve the Calculator:

  • Add GUI using Tkinter

  • Add square root, exponent, or modulus

  • Add error handling for invalid input types



๐Ÿงพ Final Thoughts

This simple calculator app is a great Python beginner project. It teaches basic functions, user input, loops, and conditional statements. If you're learning Python, projects like this are a fun and practical way to build your skills.


Tags: Python, Python Projects, Beginner Python, Python Calculator, Python Tutorial

Create a Python Kivy Android WebView App

 ๐Ÿ Introduction

In this tutorial, I'll show you how to create a simple WebView app using Python and Kivy. This app will display any website (like Google, YouTube, or your own) in an Android WebView.


We’ll use:

Python ๐Ÿ’ป

Kivy ๐Ÿ

Android (via Buildozer) ๐Ÿ“ฑ


Python Code (main.py)


from kivy.app import App
from jnius import autoclass
from kivy.clock import Clock
from android.runnable import run_on_ui_thread
from kivy.uix.widget import Widget

WebView = autoclass('android.webkit.WebView')
WebViewClient = autoclass('android.webkit.WebViewClient')
activity = autoclass('org.kivy.android.PythonActivity').mActivity

@run_on_ui_thread
def create_webview(*args):
	webview = WebView(activity)
	webview.getSettings().setJavaScriptEnabled(True)
	wvc = WebViewClient()
	webview.setWebViewClient(wvc)
	activity.setContentView(webview)
	webview.loadUrl('https://littleone7a.blogspot.com/')


class Wv(Widget):
	def __init__(self, **kwargs):
		super().__init__(**kwargs)
		self.__functionstable__ = {}
		Clock.schedule_once(create_webview, 0)


class ServiceApp(App):
	def build(self):
		return Wv()

if __name__ == '__main__':
    ServiceApp().run()

๐Ÿ› ️ buildozer.spec Settings (Important)

requirements = python3,kivy,android,docutils,pyjnius
android.permissions = INTERNET
android.archs = arm64-v8a


๐Ÿ“ฆ Build APK
command : -  buildozer -v android debug


๐ŸŒ Final Output

Your app will open a WebView and load the website you specify inside the app! You can change the URL in webview.loadUrl("...").



Tags :

Python Kivy Apps , Python Kivy , Python Kivy WebView , Python Kivy WebApp ,Python Pyjnius , Python Android Apk , Python Buildozer , Android Python Kivy ,Kivy Applications ,



Create a Smooth Loading Ball Animation in Python Using Kivy

 ๐ŸŽฏ Create a Smooth Loading Ball Animation in Python Using Kivy  Are you looking to build a visually appealing loading animation for your P...