Posts

E-mail Sender using Voice Recognition

This is a gui program which utilises tkinter (for gui), smtplib (to send email), pyttsx3 (text to speech) and speech_recognition (for voice recognition) libraries to send emails with a very little effort. Code: from  tkinter  import  * from  PIL  import  ImageTk, Image import  speech_recognition  as  sr import  pyttsx3 import  smtplib def   speak ( c ):     e = pyttsx3.init()     e.say(c)     e.runAndWait() r = sr.Recognizer() def   click ():     o = smtplib.SMTP( "smtp.gmail.com" ,  587 )     o.starttls()     o.login( "visualspprt@gmail.com" ,  "Help@123" )      while ( 1 ):          try :              with  sr.Microphone()  as  st:                 r.adjust_for_ambient_noise(st, duration = 0.2 )                 speak( "Welcome to the voice recognition mail sender, how may i help you" )                 a2 = r.listen(st)                 mt = r.recognize_google(a2)                 mt = mt.lower()                  #print(f"Did you said '{mt

Projects to consider as a bigener in PYTHON

  One of the most efficient way of becoming an expert in something is by experience. Even  in case of programing languages, we should make different projects according to our  knowledge in that language. So, here are some python projects you should make as a  beginer in python.    1. Advanced Calculator 2. Unit Converter 3. Audio Video Converter 4. YouTube Downloder 5. Password Generator 6. Number Guessing Game 7. Rock, Paper, Scissors Game 8. Hangman Game 9. TicTacToe Game 10. Binary Search Algorithm 1. Advanced Calculator: Python Programing is a great tool to evaluate. It has many  libraries (such as “math”) and many functions (such as “eval()”) to make an advanced calculator. The calculator can be both command line or graphic user interface. Exampler Syntax: sum = 5%2 sol = eval(sum) print(f”{sum} = {sol}”) Note->”You will find a GUI based calculator on this blog.” 2. Unit Converter: Python’s easy and clear syntax put programes like unit conve

HangMan game in PYTHON

Image
  What is hangman? Libraries Hangman  is a paper and pencil guessing game  for two or more players. One player thinks of a word, phrase or sentence  and the other(s) tries to guess it by suggesting  l etters  within a certain number of guesses.  wikipedia Code: import random as r listOfWords1 = ["pace", "space", "cross", "edge", "nine", "tame", "spawn", "real", "world", "seed"] listOfWords2 = ["computer", "physics", "science", "sapiens", "building"] def main():     guesses = ""     level = input("Easy(e)/Medium(m)/Hard(h):\n").lower()     print("----------")     if level == "e":         turns = 5         word = r.choice(listOfWords1)     elif level == "m":         turns = 3         word = r.choice(listOfWords1)     elif level == "h":         turns = 3         word = r.choice(list

Tic-Tac-Toe (multiplayer) using pthon

Image
  About The Game:   Tic-Tac-Toe (also known as noughts and crosses) is a paper and pencil game for two players, X and O , who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner. It is a solved game with a forced draw assuming best play from both players. wikipedia Tic-Tac-Toe in python: def printBoard ( currentPos ): print ( " {} {} {} " .format(currentPos[ 0 ], currentPos[ 1 ], currentPos[ 2 ])) print ( " {} {} {} " .format(currentPos[ 3 ], currentPos[ 4 ], currentPos[ 5 ])) print ( " {} {} {} " .format(currentPos[ 6 ], currentPos[ 7 ], currentPos[ 8 ])) def askPos (): global pos pos = int ( input ( "row (0 to 2): \n " )) if pos < 0 or pos > 8 : print ( f " { pos } is an invalid row number!" ) askPos() def updatePositions ( position , playerSymbol ): position[pos