#Build my own jarvis ai code
Developed code logic for opening VS Code or any other application.We developed the code logic for opening different websites like google, youtube, and stack overflow.This function is also responsible for returning the user’s query in a string format. After wishme() function, we have created a takeCommand() function, which helps our A.I to take command from the user.First of all, we have created a wishme() function that gives the functionality of greeting according to the system time to our A.I.We are using the try and except block to handle any possible error that can occur while sending emails. Speak ( "Email has been sent!" ) except Exception as e : print (e ) Now, we will create a sendEmail() function, which will help us to send emails to one or more than one recipients. The message:A string message which needs to be sent to one or more than one recipient.The sender: Email address of the sender.This instance method allows us to send an email. An instance method called sendmail is present in the SMTP module. Simple Mail Transfer Protocol (SMTP) is a protocol that allows us to send emails and to route emails between mail servers.To send an email, we need to import a module called smtplib. Here, I am saving the target into a variable called codePath, and then we are using the os module to open the application. Step 3: Copy the target from the target section.Īfter copying the target of the application, save the target into a variable. Step 2: Right-click on the application and click on properties. Steps to get the code path of the application: To open the VS Code or any other application, we need the code path of the application.
#Build my own jarvis ai install
It is an in-built module, and we do not need to install it with pip statement, we can directly import it into our program by writing an import statement.ĬodePath = "C:\\Users\\spyboy\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe" To open any website, we need to import a module called webbrowser. – Defining Task 2: To open YouTube site in a web-browser 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 help of speak function. In the above code, we have used an if statement to check whether Wikipedia is in the search query of the user or not. Speak ( "According to Wikipedia" ) print (results ) 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