Build a Simple Age Calculator Desktop App with Python and Tkinter

Learn how to create a desktop application using Python and Tkinter to easily calculate the age of a person. Follow this step-by-step guide to build a straightforward Age Calculator app with a graphical user interface. Get started with coding and enhance your Python skills today!

Python Code

import tkinter as tk

from datetime import datetime

def calculate_age():

    birth_year = int(entry_birth_year.get())

    current_year =

    age = current_year - birth_year

    label_result.config(text=f"Your age is: {age} years")

# Create the main window

window = tk.Tk()

window.title("Age Calculator App")

# Create and place widgets (labels, entry, button)

label_instruction = tk.Label(window, text="Enter your birth year:")


entry_birth_year = tk.Entry(window)


button_calculate = tk.Button(window, text="Calculate Age", command=calculate_age)


label_result = tk.Label(window, text="")


# Run the application




About Author provides tutorials related to tech and programmings. We are also setting up a community for the users and students.