voice-activated personal assistant app , similar to Google Assistant , Siri or alexa. I have depends on a various libraries
to handle speech recognition, such as text-to-speech.
imported libraries
.ctypes: For system-related functions, like changing wallpaper
.datetime: To get the current date and time
.json: To handle JSON data,for web requests
.os:for file management
. random: For random selection, like picking a song or asking for randome number
subprocess: To run system commands, like shutting down the computer
.time: For handling time-related functions
.webbrowser: To open web pages on the browser
.urllib.request: To make HTTP requests
. pyjokes: To get jokes just for fuuny moments
.pyttsx3: For text-to-speech functionality
.speech_recognition: For recognizing speech input
.wikipedia: To get summaries from Wikipedia
winshell: To manage Windows shell features, like recycling the bin
wolframalpha: For performing calculations using the Wolfram Alpha API
.requests: for easily HTTP requests
.BeautifulSoup: For web scraping
::functions
speak(audio): Converts text to speech using the pyttsx3 library
wishMe(): Greets the user based on the time of day and introduces the assistant which in our case named medhat
username(): Welcomes the user back and say how it can help
takeCommand(): Listens for user voice input and uses Google’s speech recognition to convert it to text to make it
understandable for the machine
( The script runs in a loop, continuously listening for commands so the logical prosses is )
search Wikipedia: Uses the Wikipedia API to fetch summaries based on user queries.
Open websites: Commands like "open youtube" will launch the corresponding website in a web browser.
Play music: Plays a random song from a specified music directory.
Get time: Tells the user the current time.
Email commands: Allows users to send emails either to a predefined address or one specified at runtime.
Tell jokes: Uses pyjokes to tell a random joke.
Calculate: Uses the Wolfram Alpha API for mathmatical calculations.
Weather information: display weather data for a specified city using the OpenWeatherMap API.
System commands: Includes options to lock the computer, shutdown, restart, and manage files.
(Error Handling)
my code contains try-except blocks to handle exceptions, especially for speech recognition and email sending
this is just a brief explanation of my code in the future in sha alla i am going to improve it to the maximum level to make him think like my brother now you know were the name medhat came from and finaly thank you
اسم المستقل | ايهاب حسام ع. |
عدد الإعجابات | 0 |
عدد المشاهدات | 5 |
تاريخ الإضافة | |
تاريخ الإنجاز |