Course Content
  • 1. Python Tutorials Teaser
    Free YouTube Video
  • 2. What Is Programming and Why Python?
    Free YouTube Video
  • 3. Downloading Python and Pycharm Installation
    Free YouTube Video
  • 4. Using Modules & Pip In Python
    Free YouTube Video
  • 5. Writing Our First Python Program
    Free YouTube Video
  • 6. Using Python As A Calculator
    Free YouTube Video
  • 7. Comments, Escape Sequences & Print Statement
    Free YouTube Video
  • 8. Variables, Datatypes and Typecasting
    Free YouTube Video
  • 9. String Slicing And Other Functions In Python
    Free YouTube Video
  • 10. Python Lists And List Functions
    Free YouTube Video
  • 11. Dictionary & Its Functions Explained
    Free YouTube Video
  • 12. Python Exercise 1 - Apni Dictionary
    Free YouTube Video
  • 13. Sets In Python
    Free YouTube Video
  • 14. If Else & Elif Conditionals In Python
    Free YouTube Video
  • 15. Exercise 1 - Solution And Your Answers
    Free YouTube Video
  • 16. Python Exercise 2 - Faulty Calculator
    Free YouTube Video
  • 17. For Loops In Python
    Free YouTube Video
  • 18. While Loops In Python
    Free YouTube Video
  • 19. Break & Continue Statements In Python
    Free YouTube Video
  • 20. Python Exercise 2: Faulty Calculator Solution
    Free YouTube Video
  • 21. Python Exercise 3 - Guess The Number
    Free YouTube Video
  • 22. Operators In Python
    Free YouTube Video
  • 23. Short Hand If Else Notation In Python
    Free YouTube Video
  • 24. Functions And Docstrings
    Free YouTube Video
  • 25. Try Except Exception Handling In Python
    Free YouTube Video
  • 26. Python File IO Basics
    Free YouTube Video
  • 27. Open(), Read() & Readline() For Reading File
    Free YouTube Video
  • 28. Python Exercise 3: Solution
    Free YouTube Video
  • 29. Writing And Appending To A File
    Free YouTube Video
  • 30. Python Exercise 4: Astrologer's Stars
    Free YouTube Video
  • 31. Seek(), tell() & More On Python Files
    Free YouTube Video
  • 32. Using With Block To Open Python Files
    Free YouTube Video
  • 33. Exercise 5: Health Management System
    Free YouTube Video
  • 34. Scope, Global Variables and Global Keyword
    Free YouTube Video
  • 35. Recursions: Recursive Vs Iterative Approach
    Free YouTube Video
  • 36. Exercise 4: Solution And First Solver
    Free YouTube Video
  • 37. Anonymous/Lambda Functions In Python
    Free YouTube Video
  • 38. Exercise 5: Solution And First Solver
    Free YouTube Video
  • 39. Using Python External & Built In Modules
    Free YouTube Video
  • 40. F-Strings & String Formatting In Python
    Free YouTube Video
  • 41. Exercise 6: Game Development: Snake Water Gun
    Free YouTube Video
  • 42. *args and **kwargs In Python
    Free YouTube Video
  • 43. Time Module In Python
    Free YouTube Video
  • 44. Virtual Environment & Requirements.txt
    Free YouTube Video
  • 45. Enumerate Function
    Free YouTube Video
  • 46. How Import Works In Python?
    Free YouTube Video
  • 47. If __name__==__main__ usage & necessity
    Free YouTube Video
  • 48. Join Function In Python
    Free YouTube Video
  • 49. Map, Filter & Reduce
    Free YouTube Video
  • 50. Exercise 6 Solution & First Solver
    Free YouTube Video
  • 51. Exercise 7: Healthy Programmer
    Free YouTube Video
  • 52. Decorators In Python
    Free YouTube Video
  • 53. Classes & Objects (OOPS)
    Free YouTube Video
  • 54. Creating Our First Class In Python
    Free YouTube Video
  • 55. Instance & Class Variables | Python Tutorials For Absolute Beginners In Hindi #54
    Free YouTube Video
  • 56. Self & __init__() (Constructors) | Python Tutorials For Absolute Beginners In Hindi #55
    Free YouTube Video
  • 57. Class Methods In Python | Python Tutorials For Absolute Beginners In Hindi #56
    Free YouTube Video
  • 58. Class Methods As Alternative Constructors | Python Tutorials For Absolute Beginners In Hindi #57
    Free YouTube Video
  • 59. Static Methods In Python | Python Tutorials For Absolute Beginners In Hindi #58
    Free YouTube Video
  • 60. Abstraction & Encapsulation | Python Tutorials For Absolute Beginners In Hindi #59
    Free YouTube Video
  • 61. Single Inheritance | Python Tutorials For Absolute Beginners In Hindi #60
    Free YouTube Video
  • 62. Multiple Inheritance | Python Tutorials For Absolute Beginners In Hindi #61
    Free YouTube Video
  • 63. Multilevel Inheritance | Python Tutorials For Absolute Beginners In Hindi #62
    Free YouTube Video
  • 64. Public, Private & Protected Access Specifiers | Python Tutorials For Absolute Beginners In Hindi #63
    Free YouTube Video
  • 65. Polymorphism In Python | Python Tutorials For Absolute Beginners In Hindi #64
    Free YouTube Video
  • 66. Super() and Overriding In Classes | Python Tutorials For Absolute Beginners In Hindi #65
    Free YouTube Video
  • 67. Diamond Shape Problem In Multiple Inheritance | Python Tutorials For Absolute Beginners In Hindi #66
    Free YouTube Video
  • 68. Operator Overloading & Dunder Methods | Python Tutorials For Absolute Beginners In Hindi #67
    Free YouTube Video
  • 69. Abstract Base Class & @abstractmethod | Python Tutorials For Absolute Beginners In Hindi #68
    Free YouTube Video
  • 70. Setters & Property Decorators | Python Tutorials For Absolute Beginners In Hindi #69
    Free YouTube Video
  • 71. Object Introspection | Python Tutorials For Absolute Beginners In Hindi #70
    Free YouTube Video
  • 72. Python Mini Project #1 | Python Tutorials For Absolute Beginners In Hindi #71
    Free YouTube Video
  • 73. Generators In Python | Python Tutorials For Absolute Beginners In Hindi #72
    Free YouTube Video
  • 74. Python Comprehensions | Python Tutorials For Absolute Beginners In Hindi #73
    Free YouTube Video
  • 75. Using Else With For Loops | Python Tutorials For Absolute Beginners In Hindi #74
    Free YouTube Video
  • 76. Function Caching In Python | Python Tutorials For Absolute Beginners In Hindi #75
    Free YouTube Video
  • 77. Else & Finally In Try Except | Python Tutorials For Absolute Beginners In Hindi #76
    Free YouTube Video
  • 78. Coroutines In Python | Python Tutorials For Absolute Beginners In Hindi #77
    Free YouTube Video
  • 79. Exercise 7: Solution & First Solver | Python Tutorials For Absolute Beginners In Hindi #78
    Free YouTube Video
  • 80. Os Module | Python Tutorials For Absolute Beginners In Hindi #79
    Free YouTube Video
  • 81. Exercise 8: Oh Soldier Prettify My Folder| Python Tutorials For Absolute Beginners In Hindi #80
    Free YouTube Video
  • 82. Requests Module For HTTP Requests | Python Tutorials For Absolute Beginners In Hindi #81
    Free YouTube Video
  • 83. Json Module | Python Tutorials For Absolute Beginners In Hindi #82
    Free YouTube Video
  • 84. Exercise 9: Akhbaar Padhke Sunaao | Python Tutorials For Absolute Beginners In Hindi #83
    Free YouTube Video
  • 85. Pickle Module | Python Tutorials For Absolute Beginners In Hindi #84
    Free YouTube Video
  • 86. Exercise 10: Pickling Iris | Python Tutorials For Absolute Beginners In Hindi #85
    Free YouTube Video
  • 87. Regular Expressions | Python Tutorials For Absolute Beginners In Hindi #86
    Free YouTube Video
  • 88. Converting .py to .exe | Python Tutorials For Absolute Beginners In Hindi #87
    Free YouTube Video
  • 89. Python Exercise 8: Solution + Tips | Python Tutorials For Absolute Beginners In Hindi #88
    Free YouTube Video
  • 90. Raise In Python + Examples | Python Tutorials For Absolute Beginners In Hindi #89
    Free YouTube Video
  • 91. Python 'is' vs '==': What's The Difference? | Python Tutorials For Absolute Beginners In Hindi #90
    Free YouTube Video
  • 92. Python 2.x Vs Python 3.x | Python Tutorials For Absolute Beginners In Hindi #91
    Free YouTube Video
  • 93. Python Exercise 9 Solution + Shoutouts | Python Tutorials For Absolute Beginners In Hindi #92
    Free YouTube Video
  • 94. Creating a Command Line Utility In Python | Python Tutorials For Absolute Beginners In Hindi #93
    Free YouTube Video
  • 95. Exercise 10: Solution + Shoutouts | Python Tutorials For Absolute Beginners In Hindi #94
    Free YouTube Video
  • 96. Creating a Python Package Using Setuptools | Python Tutorials For Absolute Beginners In Hindi #95
    Free YouTube Video
  • 97. Python Exercise 11: Regex Email Extractor | Python Tutorials For Absolute Beginners In Hindi #96
    Free YouTube Video
  • 98. Learning Path For Python Web Development | Python Tutorials For Absolute Beginners In Hindi #97
    Free YouTube Video
  • 99. Python GUI Development - Learning Path | Python Tutorials For Absolute Beginners In Hindi #98
    Free YouTube Video
  • 100. Machine Learning & Data Science Learning Path | Python Tutorials For Absolute Beginners In Hindi #99
    Free YouTube Video
  • 101. Regex Exercise 11 Solutions | Python Tutorials For Absolute Beginners In Hindi #100
    Free YouTube Video
  • 102. Mini Project 1 (OOPs Library) Solution | Python Tutorials For Absolute Beginners In Hindi #101
    Free YouTube Video
  • 103. Conclusion & Way Forward | Python Tutorials For Absolute Beginners In Hindi #102
    Free YouTube Video
  • 104. Practice Problem 1 (Easy) | Python Tutorials For Absolute Beginners In Hindi #103
    Free YouTube Video
  • 105. Python Practice 1 Solution | Python Tutorials For Absolute Beginners In Hindi #104
    Free YouTube Video
  • 106. Practice Problem 2 (Easy) | Python Tutorials For Absolute Beginners In Hindi #105
    Free YouTube Video
  • 107. Python Practice 2 Solution | Python Tutorials For Absolute Beginners In Hindi #106
    Free YouTube Video
  • 108. Python Practice 3 | Python Tutorials For Absolute Beginners In Hindi #107
    Free YouTube Video
  • 109. Python Problem 3: Solution | Python Tutorials For Absolute Beginners In Hindi #108
    Free YouTube Video
  • 110. Python Problem 4 | Python Tutorials For Absolute Beginners In Hindi #109
    Free YouTube Video
  • 111. Python Problem 4: Solution | Python Tutorials For Absolute Beginners In Hindi #110
    Free YouTube Video
  • 112. Python Problem 5 | Python Tutorials For Absolute Beginners In Hindi #111
    Free YouTube Video
  • 113. Python Problem 5: Solution | Python Tutorials For Absolute Beginners In Hindi #112
    Free YouTube Video
  • 114. Python Problem 6 | Python Tutorials For Absolute Beginners In Hindi #113
    Free YouTube Video
  • 115. Python Problem 6: Solution | Python Tutorials For Absolute Beginners In Hindi #114
    Free YouTube Video
  • 116. Python Problem 7 | Python Tutorials For Absolute Beginners In Hindi #115
    Free YouTube Video
  • 117. Python Problem 7: Solution | Python Tutorials For Absolute Beginners In Hindi #116
    Free YouTube Video
  • 118. Python Problem 8: Fake Multiplication Tables | Python Tutorials For Absolute Beginners In Hindi #117
    Free YouTube Video
  • 119. Python Problem 8: Solution | Python Tutorials For Absolute Beginners In Hindi #118
    Free YouTube Video
  • 120. Python Problem 9: Jumbled Funny Names | Python Tutorials For Absolute Beginners In Hindi #119
    Free YouTube Video
  • 121. Project 1: Iron Man Jarvis AI Desktop Voice Assistant | Python Tutorials For Absolute Beginners #120
    Free YouTube Video
  • 122. Project 2: Coding Flappy Bird Game (With Source Code) | Python Tutorials For Absolute Beginners #122
    Free YouTube Video
  • 123. Project 3: Third Umpire Decision Review System (DRS Gully Cricket) | Python Tutorials in Hindi #123
    Free YouTube Video
  • 124. Project 4: Indian Railways Announcement Software | Python Tutorials For Absolute Beginners #124
    Free YouTube Video
  • 125. CoronaVirus: Python Programming Solution to the Problem
    Free YouTube Video
  • 126. Covid -19: Creating a Realtime CoronaVirus Outbreak Notification System Using Python Programming
    Free YouTube Video
  • 127. Django Tutorial In Hindi
    Free YouTube Video
  • 128. I automated Dinosaur Game in Chrome
    Free YouTube Video
  • 129. VS Code Tutorial + Python Setup | Python Tutorials For Absolute Beginners In Hindi #121
    Free YouTube Video

Project 1: Iron Man Jarvis AI Desktop Voice Assistant | Python Tutorials For Absolute Beginners #120

Have you ever wondered how cool it would be to have your own A.I. assistant? Imagine how easier it would be to send emails without typing a single word, doing Wikipedia searches without opening web browsers, and performing many other daily tasks like playing music with the help of a single voice command. In this tutorial, I will teach you how you can make your personal A.I. assistant using Python. 

What can this A.I. assistant do for you?

  • It can send emails on your behalf.
  • It can play music for you.
  • It can do Wikipedia searches for you.
  • It is capable of opening websites like Google, Youtube, etc., in a web browser.
  • It is capable of opening your code editor or IDE with a single voice command.

Enough talks! Let's start building our own J.A.R.V.I.S.

15:25 - Defining Wish me Function :

Now, we will make a wishme() function that will make our J.A.R.V.I.S. wish or greet the user according to the time of computer or pc. To provide current or live time to A.I., we need to import a module called datetime. Import this module to your program by:

import datetime

Now, let's start defining the wishme() function:

def wishme():

hour = int(datetime.datetime.now().hour)

 

Here, we have stored the current hour or time integer value into a variable named hour. Now, we will use this hour value inside an if-else loop.

 

18:27 – Defining Take command Function :

The next most important thing for our A.I. assistant is that it should take command with the help of the microphone of the user's system. So, now we will make a takeCommand() function.  With the help of the takeCommand() function, our A.I. assistant will return a string output by taking microphone input from the user.

 Before defining the takeCommand() function, we need to install a module called speechRecognition. Install this module by: 

pip install speechRecognition

After successfully installing this module, import this module into the program by writing an import statement.

import speechRecognition as sr

 

36:58 – Defining Task 5: To know the current time
  elif 'the time' in query:
            strTime = datetime.datetime.now().strftime("%H:%M:%S")    
            speak(f"Sir, the time is {strTime}")

In the above, code we are using the datetime() function and storing the current or live system time into a variable called strTime. After storing the time in strTime, we are passing this variable as an argument in speak function. Now, the time string will be converted into speech.

 

38:45 – Defining Task 6: To open the VS Code Program
 elif 'open code' in query:
            codePath = "C:\\Users\\Haris\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
            os.startfile(codePath)

To open the VS Code or any other application, we need the code path of the application.

10:08 – Starting VS Code

I am going to use the VS Code IDE in this video. Feel free to use any other IDE you are comfortable d with. Start a new project and make a file called jarvis.py.

10:54 – Defining Speak Function

The first and foremost thing for an A.I. assistant is that it should be able to speak. To make our J.A.R.V.I.S. talk, we will make a function called speak(). This function will take audio as an argument, and then it will pronounce it.

def speak(audio):
       pass      #For now, we will write the conditions later.

Now, the next thing we need is audio. We must supply audio so that we can pronounce it using the speak() function we made. We are going to install a module called pyttsx3.

What is pyttsx3?
  • A python library that will help us to convert text to speech. In short, it is a text-to-speech library.
  • It works offline, and it is compatible with Python 2 as well as Python 3.

Installation:

pip install pyttsx3

In case you receive such errors: 

  • No module named win32com.client
  • No module named win32
  • No module named win32api

Then, install pypiwin32 by typing the below command in the terminal :

pip install pypiwin32.

After successfully installing pyttsx3, import this module into your program.

Usage:

import pyttsx3

engine = pyttsx3.init('sapi5')

voices= engine.getProperty('voices') #getting details of current voice

engine.setProperty('voice', voice[0].id)
What is sapi5?
  • Microsoft developed speech API.
  • Helps in synthesis and recognition of voice.
What Is VoiceId?
  • Voice id helps us to select different voices.
  • voice[0].id = Male voice 
  • voice[1].id = Female voice

 

Writing Our speak() Function :

We made a function called speak() at the starting of this tutorial. Now, we will write our speak() function to convert our text to speech.

def speak(audio):

engine.say(audio) 

engine.runAndWait() #Without this command, speech will not be audible to us.

Creating Our main() function: 

We will create a main() function, and inside this main() Function, we will call our speak function.

Code:

if __name__=="__main__" :

speak("Code With Harry")

 

Whatever you will write inside this speak() function will be converted into speech. Congratulations! With this, our J.A.R.V.I.S. has its own voice, and it is ready to speak.

Let's start coding the takeCommand() function :

def takeCommand():
    #It takes microphone input from the user and returns string output

    r = sr.Recognizer()
    with sr.Microphone() as source:
        print("Listening...")
        r.pause_threshold = 1
        audio = r.listen(source)

 

We have successfully created our takeCommand() function. Now we are going to add a try and except block to our program to handle errors effectively.

  try:
        print("Recognizing...")    
        query = r.recognize_google(audio, language='en-in') #Using google for voice recognition.
        print(f"User said: {query}\n")  #User query will be printed.

    except Exception as e:
        # print(e)    
        print("Say that again please...")   #Say that again will be printed in case of improper voice 
        return "None" #None string will be returned
    return query

 

27:30 – Coding logic of Jarvis

 Now, we will develop logic for different commands such as Wikipedia searches, playing music, etc.

 28:04 – Defining Task 1: To search something on Wikipedia 

 To do Wikipedia searches, we need to install and import the Wikipedia module into our program. Type the below command to install the Wikipedia module :

pip install wikipedia

 After successfully installing the Wikipedia module, import it into the program by writing an import statement.

if __name__ == "__main__":
    wishMe()
    while True:
    # if 1:
        query = takeCommand().lower() #Converting user query into lower case

        # Logic for executing tasks based on query
        if 'wikipedia' in query:  #if wikipedia found in the query then this block will be executed
            speak('Searching Wikipedia...')
            query = query.replace("wikipedia", "")
            results = wikipedia.summary(query, sentences=2) 
            speak("According to Wikipedia")
            print(results)
            speak(results)

In the above code, we have used an if statement to check whether Wikipedia is in the user's search query or not. If Wikipedia is found in the user's search query, then two sentences from the summary of the Wikipedia page will be converted to speech with the speak function's help.

31:24 – Defining Task 2: To open YouTube site in a web-browser

 To open any website, we need to import a module called webbrowser. It is an in-built module, and we do not need to install it with a pip statement; we can directly import it into our program by writing an import statement.

Code: 

     elif 'open youtube' in query:
            webbrowser.open("youtube.com")

Here, we are using an elif loop to check whether Youtube is in the user's query. Let' suppose the user gives a command as "J.A.R.V.I.S., open youtube." So, open youtube will be in the user's query, and the elif condition will be true.

32:34 – Defining Task 3: To open Google site in a web-browser
elif 'open google' in query:
            webbrowser.open("google.com")

We are opening Google in a web-browser by applying the same logic that we used to open youtube. 

33:37 – Defining Task 4: To play music 

To play music, we need to import a module called os. Import this module directly with an import statement.

elif 'play music' in query:
            music_dir = 'D:\\Non Critical\\songs\\Favorite Songs2'
            songs = os.listdir(music_dir)
            print(songs)    
            os.startfile(os.path.join(music_dir, songs[0]))

In the above code, we first opened our music directory and then listed all the songs present in the directory with the os module's help. With the help of os.startfile, you can play any song of your choice. I am playing the first song in the directory. However, you can also play a random song with the help of a random module. Every time you command to play music, J.A.R.V.I.S. will play any random song from the song directory.

 Steps to get the code path of the application:

Step 1: Open the file location.

Step 2: Right-click on the application and click on properties.

Step 3: Copy the target from the target section.

After copying the target of the application, save the target into a variable. Here, I am saving the target into a variable called codePath, and then we are using the os module to open the application.

 

41:05 – Defining Task 7: To send Email

To send an email, we need to import a module called smtplib.

What is smtplib?

  • Simple Mail Transfer Protocol (SMTP) is a protocol that allows us to send emails and route emails between mail servers. An instance method called sendmail is present in the SMTP module. This instance method allows us to send an email.  It takes 3 parameters:
  • The sender: Email address of the sender.
  • The receiver: T Email of the receiver.
  • The message: A string message which needs to be sent to one or more than one recipient.

44:03 – Defining Send email function :

We will create a sendEmail() function, which will help us send emails to one or more than one recipient.

def sendEmail(to, content):
    server = smtplib.SMTP('smtp.gmail.com', 587)
    server.ehlo()
    server.starttls()
    server.login('youremail@gmail.com', 'your-password')
    server.sendmail('youremail@gmail.com', to, content)
    server.close()

In the above code, we are using the SMTP module, which we have already discussed above.

Note: Do not forget to 'enable the less secure apps' feature in your Gmail account. Otherwise, the sendEmail function will not work properly.

Calling sendEmail() function inside the main() function:    

 elif 'email to harry' in query:
            try:
                speak("What should I say?")
                content = takeCommand()
                to = "harryyourEmail@gmail.com"    
                sendEmail(to, content)
                speak("Email has been sent!")
            except Exception as e:
                print(e)
                speak("Sorry my friend harry bhai. I am not able to send this email")    

We are using the try and except block to handle any possible error while sending emails.

51:26 – Recapitulate

  1. First of all, we have created a wishme() function that gives the greeting functionality according to our A.I system time.
  2. After wishme() function, we have created a takeCommand() function, which helps our A.I to take command from the user. This function is also responsible for returning the user's query in a string format.
  3. We developed the code logic for opening different websites like google, youtube, and stack overflow.
  4. Developed code logic for opening VS Code or any other application.
  5. At last, we added functionality to send emails.

 

56:13 – Is it an A.I.?

Many people will argue that the virtual assistant that we have created is not an A.I, but it is the output of a bunch of the statement. But, if we look at the fundamental level, the sole purpose of A.I develop machines that can perform human tasks with the same effectiveness or even more effectively than humans.

It is a fact that our virtual assistant is not a very good example of A.I., but it is an A.I.!

58:30 – The E.N.D.

With this, you have successfully made your very first virtual assistant. Explore and try to add other functionalities to J.A.R.V.I.S. I hope you all have liked this tutorial. Feel free to ask your queries in the QnA section.

Code as described/written in the video

import pyttsx3 #pip install pyttsx3
import speech_recognition as sr #pip install speechRecognition
import datetime
import wikipedia #pip install wikipedia
import webbrowser
import os
import smtplib

engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
# print(voices[1].id)
engine.setProperty('voice', 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("I am Jarvis Sir. Please tell me how may I help you")       

def takeCommand():
    #It takes microphone input from the user and returns string output

    r = sr.Recognizer()
    with sr.Microphone() as source:
        print("Listening...")
        r.pause_threshold = 1
        audio = r.listen(source)

    try:
        print("Recognizing...")    
        query = r.recognize_google(audio, language='en-in')
        print(f"User said: {query}\n")

    except Exception as e:
        # print(e)    
        print("Say that again please...")  
        return "None"
    return query

def sendEmail(to, content):
    server = smtplib.SMTP('smtp.gmail.com', 587)
    server.ehlo()
    server.starttls()
    server.login('youremail@gmail.com', 'your-password')
    server.sendmail('youremail@gmail.com', to, content)
    server.close()

if __name__ == "__main__":
    wishMe()
    while True:
    # if 1:
        query = takeCommand().lower()

        # Logic for executing tasks based on query
        if 'wikipedia' in query:
            speak('Searching Wikipedia...')
            query = query.replace("wikipedia", "")
            results = wikipedia.summary(query, sentences=2)
            speak("According to Wikipedia")
            print(results)
            speak(results)

        elif 'open youtube' in query:
            webbrowser.open("youtube.com")

        elif 'open google' in query:
            webbrowser.open("google.com")

        elif 'open stackoverflow' in query:
            webbrowser.open("stackoverflow.com")   


        elif 'play music' in query:
            music_dir = 'D:\\Non Critical\\songs\\Favorite Songs2'
            songs = os.listdir(music_dir)
            print(songs)    
            os.startfile(os.path.join(music_dir, songs[0]))

        elif 'the time' in query:
            strTime = datetime.datetime.now().strftime("%H:%M:%S")    
            speak(f"Sir, the time is {strTime}")

        elif 'open code' in query:
            codePath = "C:\\Users\\Haris\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
            os.startfile(codePath)

        elif 'email to harry' in query:
            try:
                speak("What should I say?")
                content = takeCommand()
                to = "harryyourEmail@gmail.com"    
                sendEmail(to, content)
                speak("Email has been sent!")
            except Exception as e:
                print(e)
                speak("Sorry my friend harry bhai. I am not able to send this email")    

You need to be logged in to post a comment!

Comments

flux0806 Jun 4, 2021
Import "speechRecognition" could not be resolvedPylancereportMissingImports Iss issue ko resolve krdo bhai pls.
parth2009 May 30, 2021
Today, I saw your video of how to make a jarvis in python and after that when I made jarvis then it was showing me an error of pyaudio is not found then, I saw your old in which you told how to install pyaudio after that I install it. But now an error is coming in jarvis app that No module name 'pyttsx3' but I have already installed it so why it showing me so And I have also typed pip install pypiwin32 but still not working
Show 2 replies
liza May 2, 2021
my program is unable to fetch my audio commands and my code has no error it just gives messages like listening ... and never takes command please guide Harry
Show 1 replies
deb May 1, 2021
Harry bhai just loved it. Thanks very much bro
niteshv69 Apr 15, 2021
I need documents of this project please harry bhaiya help me.

Resources

No resource files associated with this project

Course Announcements

Any Course related announcements will be posted here