Popular posts from this blog
Design Using Python Turtle Graphics
Design Using Python Turtle Graphics CODE from turtle import Turtle, Screen screen = Screen() screen.bgcolor( 'white' ) tim = Turtle() tim.color( 'red' ) tim.speed( 'fastest' ) def square (): for _ in range ( 4 ): tim.forward( 200 ) tim.right( 90 ) num = 75 while num != 0 : square() new_pointing = tim.heading() - 5 tim.setheading(new_pointing) num -= 1 screen.exitonclick()
Text To Voice Using Python
Text To Voice Using Python code mport pyttsx3 import datetime engine = pyttsx3.init( 'sapi5' ) voices = engine.getProperty( 'voices' ) engine.setProperty( 'voices' , voices[ 0 ].id) def speak ( audio ): engine.say(audio) engine.runAndWait() def wishme (): hour = int (datetime.datetime.now().hour) if hour>= 0 and hour< 12 : speak( "good morning" ) elif hour>= 12 and hour<= 18 : speak( "good afternoon" ) else : speak( "good evening" ) speak( "hi mehul i am your assistant. how are you" ) a= input () if a == "i am fine" : speak( "it's good that you are fine " ) if __name__ == "__main__" : wishme()
Comments
Post a Comment