Skip to main content

Command Palette

Search for a command to run...

Build a Notes App Using Python and Flet (Beginner Friendly Tutorial)

- By Pratyush Mishra

Updated
4 min read
Build a Notes App Using Python and Flet (Beginner Friendly Tutorial)
P

Do you need help with programming? You are not the only one. In this channel, we tackle gradual programming topics and end the videos on cool projects you can work on for practice to improve your skills on that given topic, step by step. Join us as we use fun and practical projects to grow our programming skills.😊💻.

If you’ve ever wanted to build a modern desktop app using only Python, without writing HTML, CSS, or JavaScript, then Flet is one of the easiest ways to get started.

In this article, we’ll build a simple Notes App using Python and Flet. The application will allow users to:

  • Add notes

  • Delete notes

  • Store notes permanently using JSON

  • View notes in a clean UI

By the end, you’ll understand how Python can be used to build real GUI applications.


What is Flet?

Flet is a Python framework that allows you to build Flutter-style UI applications using only Python.

With Flet you can create:

  • Desktop apps

  • Web apps

  • Mobile apps

All from a single Python codebase.


Install Requirements

First install Flet:

pip install flet

Create a new file called:

main.py

Step 1: Import Required Libraries

import flet as ft
import json
import os
  • Flet → Builds the UI

  • json → Stores notes permanently

  • os → Checks if the notes file exists


Step 2: Create Data Storage

We will store notes inside a JSON file.

DATA_FILE = "notes.json"

Step 3: Load Saved Notes

def load_notes():
    if not os.path.exists(DATA_FILE):
        return []
    with open(DATA_FILE, "r") as f:
        return json.load(f)

This function loads notes when the app starts.

If the file doesn’t exist yet, it simply returns an empty list.


Step 4: Save Notes

def save_notes(notes):
    with open(DATA_FILE, "w") as f:
        json.dump(notes, f, indent=4)

Whenever a note is added or deleted, the updated list is saved to the JSON file.


Step 5: Build the Main App

def main(page: ft.Page):
    page.title = "Proxlight Notes App"
    page.theme_mode = ft.ThemeMode.LIGHT
    page.padding = 20
    page.scroll = ft.ScrollMode.AUTO

Here we configure the application window.


Step 6: Create the Notes Input

note_input = ft.TextField(
    hint_text="Write your note here...",
    multiline=True,
    expand=True,
    min_lines=3,
)

This input box allows users to type notes.


Step 7: Display Notes

notes_column = ft.Column(spacing=10)

Each note will be displayed inside this vertical layout.


Step 8: Add Notes Function

def add_note(e):
    text = note_input.value.strip()
    if text == "":
        return
    notes.append(text)
    save_notes(notes)
    note_input.value = ""
    refresh_notes()

This function:

  1. Reads the input

  2. Adds the note

  3. Saves it

  4. Updates the UI


Step 9: Delete Notes

def delete_note(index):
    notes.pop(index)
    save_notes(notes)
    refresh_notes()

Each note has a delete button attached to it.


Step 10: Launch the App

ft.app(target=main)

This starts the Flet application.


Final Result

You now have a working Notes App built completely with Python.

Features include:

  • Clean UI

  • Persistent storage

  • Add and delete notes

  • Beginner-friendly code


Full Source Code

You can find the complete project on GitHub:

👉 https://github.com/Proxlight/Notepad-using-flet.git


Watch the Full Video Tutorial

I also created a step-by-step video explaining how this app is built.

📺 Watch here:

👉 https://youtu.be/ZOLWzioqr50


Why This Project Is Useful

Building projects like this helps you learn:

  • Python GUI development

  • File handling with JSON

  • UI design with Flet

  • Real-world application structure

If you’re learning Python, small projects like this are the fastest way to improve.


Final Thoughts

Flet is quickly becoming one of the easiest frameworks for building cross-platform applications with Python.

Instead of learning multiple languages, you can create desktop, web, and mobile apps using only Python.

If you enjoyed this project, consider exploring:

  • To-Do apps

  • Markdown note editors

  • Task managers

  • Database-powered apps


Follow for more Python projects, coding tutorials, and developer guides 🚀