Join our WhatsApp Channel
Cart / 0.00$

No products in the cart.

Visit Support Portal
No Result
View All Result
Monday, July 20, 2026
  • Home
  • Tutorials
    • Machine Learning
    • Python
    • Web Development
    • Javascript
    • Mathematics
    • Deep Learning
    • Artificial Intelligence
  • Store
  • Our ServicesBook Now
    • Managed Hosting Services
    • Web Development Services
  • Our Softwares
    • JaggoRe AIFree
    • Email ExtractorPaid
    • TimeWell AppFree
Get a Free Quote
  • Login
  • Register
Neuraldemy
Monday, July 20, 2026
Cart / 0.00$

No products in the cart.

No Result
View All Result
Neuraldemy
Get A Free Quote
Home Free

Notes App In Python: Complete Tutorial

Amritesh Kumar by Amritesh Kumar
November 30, 2023 - Updated on August 1, 2024
in Python
Reading Time: 10 mins read
A A
Notes App In Python: Complete Tutorial

This unique notes app in Python allows users to create and manage notes on their computers. It’s user-friendly and tested. In case you find any bugs feel free to report them. Try on your own and see what you can achieve. Please note this app is the result of my own thought process. Unique suggestions and improvements are welcome.

In this project you will learn:

  1. How to work with files.
  2. How to check if certain file types exist on the system.
  3. How to work with OS and glob modules.
  4. How to find files of a certain type.
  5. How to accept user input, and validate them based on stored files.
  6. How to change user input based on project requirements.
  7. How to allow users to create, write, update and delete their notes and data.
  8. How to delete a word and replace it with a new word or a line in text from any position.
  9. How to work with the cursor so that users can edit their notes.
  10. How to insert new lines anywhere in the text.
  11. How to make a user-friendly app by handling errors.
  12. How to use while loop and for loop with file management.
  13. and many things.

Prerequisites:

  1. Python Functions & OS module

Please note there are some limitations in the update_note() function due to the operating system. Rest everything works fine. It’s a great project to learn the os module, file r,w, r+ and more. Make sure to code along to build your project. Open your Jupyter Notebook and write as you progress. Jupyter Notebook is a great way to validate your code’s output and error.

Let’s import libraries and write a function to check notes and print the file name.

import os
import glob 

def my_notes():
    
    if len(glob.glob("*.txt")) == 0:
        print("You don't have any notes")
        
    else:
        print("Your notes are:\n")
        for file in os.listdir():
            if file.endswith(".txt"):
                print(file)

Allow the user to create a note and check if it exists already to validate and offer the best user experience.

def create_note():
    
    note_name = input("Please enter a note name\n")
    
    if ".txt" in note_name:
        note_name = note_name
    else:
        note_name = note_name + ".txt"
         
    try:
        with open(note_name, 'x') as note:
            note.write('')
            
    except FileExistsError:
        
         print('Ohho! this note name already exist. Try again.')
            
    else:
        print("Your note created. You can start writing now")
        my_notes()

Allow the user to write something to the selected note file.

def write_note():
    
    if len(glob.glob("*.txt")) == 0:
        print("You don't have any notes")
    
    else:
        notename = input('Enter the name of the note to work with\n')
        
        if ".txt" in notename:
            notename = notename
        else:
            notename = notename + ".txt"
        
        if not os.path.exists(notename):
            print("Note does not exist. Please create a new note.")   
            
        else:
            with open(notename, 'a') as note:
                while True:
                    take_note = input("Please enter your texts or Q/q to exit \n")
                    if take_note in ["q", "Q"]:
                        break
                    else:
                        note.write(take_note + "\n")
                        
            with open(notename, 'r') as note:
                content = note.read()
                print("your updated note is: ")
                print(content)

Allow user to delete a single note:

def delete_note():
    
    if len(glob.glob("*.txt")) == 0:
        print("You don't have any notes")
    
    else:
        
        filename = input("Enter the note name to be deleted forever\n")
        if ".txt" in filename:
            filename = filename
        else:
            filename = filename + ".txt"
            
        if os.path.exists(filename):
            os.remove(filename)
            print("\nYour note has been deleted")
        else:
            print('This note does not exist')

Allow users to delete all notes or view all notes:

def delete_all():
    
    if len(glob.glob("*.txt")) == 0:
        print("You don't have any notes")
    
    else:
        for file in os.listdir():
            if file.endswith(".txt"):
                os.remove(file)
                print("All your notes has been deleted.")
                
def view_all():
    
    if len(glob.glob("*.txt")) == 0:
        print("You don't have any notes")
        
    else:
        print(f"Your notes overviews\n")
        for file in os.listdir():
            if file.endswith(".txt"):
                with open(file) as f:
                    print(f"Your {file} note contains: \n{f.read()}")

Now this is the toughest part. Once the user has written something to the note how you are going to allow them to update that particular note? Here is what you can achieve to a great extent:

def update_note():
    
    view_all()
    
    choice = input("choose a note you want to update\n")
    
    if ".txt" in choice:
        choice = choice
    else:
        choice = choice + ".txt"
        
    if not os.path.exists(choice):
        print("Note does not exist. Please create a new note.")
        
    else: 
        print("\nYour note choice is:\n", choice)
        print("\n")
        print("Enter your preference:\n")
        print("Clear note content: 1")
        print("Rewrite note content: 2")
        print("Delete a word/replace a word/insert word or a sentence at a position: 3")
        
        try:
            action = int(input("Enter a choice between 1, 2, 3\n"))
            
        except ValueError:
            print("Please enter the mentioned choice only\n")
    
        else:
            if action not in [1, 2, 3]:
                print('Please enter a valid value\n')
        
            elif action == 1:
                with open(choice, 'w') as file:
                    file.write(' ')
                    print("Your note content is cleared.")
            
            elif action == 2:
                
                with open(choice, 'w') as note:
                    while True:
                        take_note = input("Please enter your texts or Q/q to exit \n")
                        
                        if take_note in ["q", "Q"]:
                            break
                        else:
                            note.write(take_note + "\n")
                            
                with open(choice) as note:
                    print("your updated note is: ")
                    print(note.read())
                    
            elif action == 3:
                
                with open(choice, "r+") as file:
                    content = file.read().split()
                    print("Content length is:", len(content))
                    print("Your content is:", ' '.join(content))
                    
                    try:
                        cursor_input = int(input("Enter the word position to replace a word or insert a sentence or enter above range for adding something to end \n."))
                        cursor = file.seek(cursor_input - 1)
                        print("\nYour modified position now is:", cursor_input)
                        
                        try:
                            content.pop(cursor)
                            
                        except IndexError:
                            print("Please enter the value within range to update word or add something new else it will be added to the end")
                    
                    except ValueError:
                        print("Enter number only within range")
                    
                    else:
                        replacement_input = input("Enter the word/sentence to added at the position. Hit enter if you just want to delete the word at that position.")
                        content.insert(cursor, replacement_input)
                        content = ' '.join(content)
                        print(content)
                        with open(choice, "w") as file:
                            file.write(content)

Thanks for reading. If you want to build another app then check out this post that will teach you how you can build your e-commerce app in Python.

Support

Buy author a coffee

Support
Tags: Python ProjectsPython Tutorial
SummarizeSendShareTweetScan
Previous Post

E-commerce App In Python – User Facing

Next Post

Create A To-Do-List App In Python: Complete Tutorial

Amritesh Kumar

Amritesh Kumar

My goal here is to simplify AI for all. Please help me improve this platform by contributing your knowledge on machine learning, web dev and data science, or help me improve current tutorials. I want to keep all the resources free except for support and notes.

Related Posts

pickle module in python

Pickle Module In Python: A Comprehensive Guide for Beginners

Python Os Module

Python OS Module: A Comprehensive Guide for Beginners

Install Miniconda on Windows (The EASIEST Way! )

Install Miniconda on Windows (The EASIEST Way! )

TensorFlow Simplified Guide For Beginners

Create A To-Do-List App In Python: Complete Tutorial

E-commerce App In Python – User Facing

Next Post
Create A To-Do-List App In Python

Create A To-Do-List App In Python: Complete Tutorial

Why AI Won’t Replace Your Jobs!!

Why AI Won’t Replace Your Jobs!!

AI & Jobs: Understanding How Things May Actually Happen

AI & Jobs: Understanding How Things May Actually Happen

Support

Buy author a coffee

Support

Support Neuraldemy

Newsletter

Top rated products

  • Probability and Statistics for Machine Learning and Data Science Probability and Statistics for Machine Learning and Data Science
    Rated 5.00 out of 5
    30.00$ Original price was: 30.00$.12.99$Current price is: 12.99$.
  • SVM Notes: Optimization & Implementation SVM Notes: Optimization & Implementation
    Rated 5.00 out of 5
    9.99$ Original price was: 9.99$.4.99$Current price is: 4.99$.
  • spidy mail hunter software Spidy Mail Hunter: Powerful And Intelligent Website & PDF Email Extractor Software (Windows App)
    Rated 4.78 out of 5
    149.00$ Original price was: 149.00$.49.00$Current price is: 49.00$.
  • Linear Algebra For Machine Learning And Data Science Linear Algebra For Machine Learning And Data Science
    Rated 4.71 out of 5
    40.00$ Original price was: 40.00$.24.99$Current price is: 24.99$.
  • Clustering and Outlier Detection A Comprehensive Tutorial Clustering and Outlier Detection 20.97$ Original price was: 20.97$.13.47$Current price is: 13.47$.

Recent Posts

Git Tutorial: A Beginners Guide To Git And GitHub

Why RAM Prices Will Continue To Rise?

100 CSS Interview Questions

100 CSS Interview Questions

July 2026
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  
« Mar    

Neuraldemy

Neuraldemy

Neuraldemy

Software Development

Neuraldemy helps you learn ML, AI, Web Dev and data science from scratch. Addtionally, we also provide web development and hosting services for businesses, and individuals

  • Get Started
  • Contact
  • Book Services
  • Privacy Policy
  • Terms Of Use
  • Support Portal
  • Managed Hosting Terms
  • Web Development Terms
  • Refund Policy
Neuraldemy

© 2026 - A learning platform by Odist Magazine

Welcome Back!

Login to your account below

Forgotten Password? Sign Up

Create New Account!

Fill the forms below to register

*By registering into our website, you agree to the Terms & Conditions and Privacy Policy.
All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result
Join Our WhatsApp Channel
  • Home
  • Tutorials
    • Machine Learning
    • Python
    • Web Development
    • Javascript
    • Mathematics
    • Deep Learning
    • Artificial Intelligence
  • Store
  • Our Services
    • Managed Hosting Services
    • Web Development Services
  • Our Softwares
    • JaggoRe AI
    • Email Extractor
    • TimeWell App
  • Login
  • Sign Up
  • Cart
Order Details

© 2026 - A learning platform by Odist Magazine

This website uses cookies. By continuing to use this website you are giving consent to cookies being used.
0