Skip to content

Added comments #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions jarvis.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ def takeCommand(): # takes microphone inout and returns output
email = f.readline().strip()
password = f.readline().strip()

def sendemail(to, content):
def sendemail(to, content): #function to send email
server = smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
server.login(email, password)
server.sendmail(email, to, content)
server.close()

def readBooks():
def readBooks(): # function to read books
speak("Enter the path of the file including it's name.")
filePath = input("Enter the path of the file (including it's name): ")
try:
Expand All @@ -135,7 +135,7 @@ def readBooks():
except:
speak("This Book is not Present!")

def NasaNews(API_KEY):
def NasaNews(API_KEY): # function to get news from NASA
speak("On which day would you like to know ?")
Date = input("Enter date as (2022-10-21): ")

Expand Down Expand Up @@ -205,11 +205,11 @@ def NasaNews(API_KEY):
elif 'stop' in query or 'shut up' in query or 'sleep' in query:
speak('Alright Sir! Ping me up when you need me again')
sys.exit(0)

# break
elif 'thank you' in query or 'appreciate' in query:
speak("It's my duty to assist you anytime sir")


# break
elif 'open youtube' in query:
speak("Here We Go")
webbrowser.open("youtube.com")
Expand Down Expand Up @@ -276,7 +276,7 @@ def move_snake():
if not food_collision():
snake.pop(0)


# Check for collision with walls
if snake[-1][0] > w / 2:
snake[-1][0] -= w
elif snake[-1][0] < - w / 2:
Expand Down