Python - Projects

Learning any programming language is a tedious task. The advantage with Python is that you can start making real projects within no time
Here are some very fundamental yet powerful pieces of mode which look simple but are extremely effective and use various python packages

Drink Water Notification



import time from plyer import notification while True: notification.notify( title = "Please Drink Water", message = "Keep yourself hydrated", #app_icon = "Your Path\Glass-Water.ico", timeout = 2 ) time.sleep(10)


Program Description


  • This simple program will give you notification to drink water
  • It makes use of Python plyer module to give notification
  • Duration of the notification before it goes off can be set
  • Frequency of the notification can be modified using sleep





Guessing Game



import random random_number = random.randint(1,10) your_guess = 0 credit = 10 level = 1 #Rules print('''* Guess a number between 1-10 * You have a credit of 10 * Exact answer will fetch you +5 * If answer is +- 3 range it will give you +3 Otherwise -5''') while credit > 0: print("You are on level",level,"credit score is",credit) your_guess = int(input("Enter your Guess ")) if your_guess == random_number: credit+=3 level = level + 1 print("You guessed it right !!,number changed") random_number = random.randint(1,10) elif (random_number-3) < your_guess < (random_number+3): print("You are close but not exact, Try harder") credit+=1 level+=1 else: print("You are not even close to the number :-( ") credit-=5 if credit <= 0: print("Correct guess was",random_number) print("You reached level",level)





Program Description


  • This Program makes use of Python loops in a very intresting way
  • Random module generates a random number which is updated as per rules
  • Player also has a score which is calculated as per the rules
  • Program ends when the user credit finishes and tells you which level you could reach
  • This simple program teaches data types, loops, random module and comparison





Send Whatsapp Message





import pywhatkit pywhatkit.sendwhatmsg("+91xxxxxxxxxx", "Hello from Sender", 22,28)


Program Description


  • This program will send a whastapp message to the number specified in your program
  • After the program is executed, whatsapp web will open in a new window
  • Pywhatkit is the Python module used in this program
  • This program may look very simple but imagine if you put this on an infinite loop :-p





Send Emails




import smtplib server = smtplib.SMTP_SSL("smtp.gmail.com",465) server.login("sender@gmail.com","password") server.sendemail("sender@gmail.com","to@gmail.com", "message to be sent") server.quit()


Program Description


  • This program will send an email to the address specified in your program
  • smtplib is the Python module used in this program
  • Similar to whatsapp program if you put this on a loop, will create a havoc in the receiver's mailbox