Water Reminder in Python

by codingwitht2 in Circuits > Software

847 Views, 1 Favorites, 0 Comments

Water Reminder in Python

Water reminder in python.png

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

Screenshot (32).png

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

Screenshot (33).png

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:-

Click Here

Checking the Output

Screenshot (34).png

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

Check Out the Video for Further Understanding of the Project

How to make a water reminder in python | CodingWithT2|Python Projects 1