Water Reminder in Python
In this project we are going to make a desktop water reminder with the help of python
In our busy lives we often tend to ignore our health by not drinking the adequate amount of water
This project will help you to build a desktop water reminder in python
Supplies
- Python Installed in your Computer from www.python.org
- An .ico file of a glass of water ,you can download it from here
Open Idle & Install Plyer Module
Firstly Open Python Idle from your start menu and create a new python file
Now open command prompt and type
pip install plyer
Plyer is a module in python that helps you to create desktop notifications. We will be using this module in our project
Importing the Required Modules and Understanding the Algorithm
First do the following imports in your python file
import time
from plyer import notification
Now its time to understand the program algorithm:-
- Import the modules
- Entering the main loop
- Displaying a notification
Writing the Program
Now, as we have understood the algorithm let us start programming
After the import statement
while True:
if __name__=='__main__':
notification.notify(title='Drink water',
message='The U.S. National Academies of Sciences, Engineering, and Medicine determined that an
adequate daily fluid intake is: About 15.5 cups (3.7 liters) of fluids a day for men. About 11.5 cups (2.7 liters) of fluids a day for women.',
app_icon='glass.ico')#You need to convert your notification icon from png to ico
time.sleep(60*60)## Sleeping the program for 1 hr to add a delay of 1 hr
The link to ico file and python file is given below:-
Checking the Output
Now run your python file and check the output
You can also run the python file in background by typing the following command in your command prompt
pythonw '.\Water reminder.py'
Write the file name instead of water reminder
Yay! Your own desktop water reminder is ready to use