
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
Birthday Reminder Application in Python
In this section we will see how to create a birthday reminder application using Python.
Problem Statement
Create an application using Python, which can check whether there is any birthday on the current day or not. If it is the birthday of some listed person, send a notification to the System with the name of that person.
We need a file, where we can store the date and month and the name of the person as a lookup file for this application. The file will look like this −

Here we will convert this application to a start-up application to start when the system starts.
Steps to create Birthday Reminder Application
- Take the lookup file and read from it.
- Whether the date and month is matched with the current date and month
- Send notification to the system with all of the names whose birthday is today.
- Stop
Example Code
importos, time #Take the birthday lookup file from home directory file_path = os.getenv('HOME') + '/birth_day_lookup.txt' defcheck_birthday(): lookup_file = open(file_path, 'r') #open the lookup file as read mode today = time.strftime('%d-%B') #get the todays date as dd-Month format bday_flag = 0 #loop through each entry in the birthday file, and check whether the day is present or not for entry inlookup_file: if today in entry: line = entry.split(' ') #cut the line on spaces to get name and surname bday_flag = 1 os.system('notify-send "Today is '+line[1]+' '+line[2]+''s Birthday"') ifbday_flag == 0: os.system('notify-send "No birthday for today is listed"') check_birthday()
Output

Steps to setup the birthday reminder as the startup application
Step 1 − Convert the script file as executable file by using the chmod command
sudochmod +x file_name.py
Step 2 − Move the script file to /usr/bin directory.
sudocp file_name.py /usr/bin
Step 3 − Now search for the Startup Applications, and start it.

After opening the application go to add, and give desired name, then the program name in the command field. And add as startup application.

- Related Articles
- Birthday Paradox in Python
- Python Program for Find reminder of array multiplication divided by n
- Birthday Paradox in C++
- Birthday attack in Cryptography
- How to Create a Reminder Notification in Android?
- Birthday Cake Alternatives
- Java Program to check the birthday and print Happy Birthday message
- Haskell Program to Check the birthday and print Happy Birthday message
- divmod() in Python and its application
- isprintable() in Python and its application
- Find reminder of array multiplication divided by n in C++
- Python Language advantages and application
- Get Application Version using Python
- How to Calculate Age in Excel from Birthday?
- C++ program to print Happy Birthday
