From 8647d5b84e6db94aeeb5d5fd1f3e2ab79f5076fb Mon Sep 17 00:00:00 2001 From: Joe Woods Date: Tue, 6 Oct 2020 21:47:28 +0100 Subject: [PATCH 1/2] inspirational quote --- jarvis.py | 11 +++++++++++ quotes.txt | 30 ++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 quotes.txt diff --git a/jarvis.py b/jarvis.py index 13d3a67..c0e77db 100644 --- a/jarvis.py +++ b/jarvis.py @@ -18,6 +18,7 @@ from sys import platform import os import getpass +import random engine = pyttsx3.init() voices = engine.getProperty('voices') @@ -114,6 +115,12 @@ def screenshot(): img = pyautogui.screenshot() img.save('path of folder you want to save/screenshot.png') +def inspirational_quote(): + quotes = open('quotes.txt').read().splitlines() + myQuote = random.choice(quotes) + speak(myQuote) + + if __name__ == '__main__': @@ -275,6 +282,10 @@ def screenshot(): else: engine.setProperty('voice', voices[1].id) speak("Hello Sir, I have switched my voice. How is it?") + + elif 'quote' in query: + speak('Fetching inspirational quote') + inspirational_quote elif 'email to gaurav' in query: try: diff --git a/quotes.txt b/quotes.txt new file mode 100644 index 0000000..6b06f3c --- /dev/null +++ b/quotes.txt @@ -0,0 +1,30 @@ +Laugh and the world laughs with you, snore and you sleep alone. +A successful man is one who makes more money than his wife can spend. A successful woman is one who can find such a man. +Roses are red, violets are blue, I'm schizophrenic, and so am I +A woman's mind is cleaner than a man's: She changes it more often. +Behind every great man is a woman rolling her eyes. +People who think they know everything are a great annoyance to those of us who do. +The universe is a big place, perhaps the biggest. +Conscience is a mother-in-law whose visit never ends. +Legend: A lie that has attained the dignity of age. +The only really happy folk are married women and single men. +There is always an easy solution to every problem - neat, plausible, and wrong. +Marriage is a wonderful institution, but who would want to live in an institution? +Strike an average between what a woman thinks of her husband a month before she marries him and what she thinks of him a year afterward, and you will have the truth about him." +An idealist is one who, on noticing that a rose smells better than a cabbage, concludes that it will also make better soup. +A cynic is a man who, when he smells flowers, looks around for a coffin. +If Barbie is so popular, why do you have to buy her friends? +A verbal contract is not worth the paper it's written on. +Facts are stupid things. +I never comment on referees and I'm not going to break the habit of a lifetime for that prat." +Solutions are not the answer. +I knew I was an unwanted baby when I saw that my bath toys were a toaster and a radio. +Happiness is your dentist telling you it won't hurt and then having him catch his hand in the drill. +A dentist at work in his vocation always looks down in the mouth. +Every tooth in a man's head is more valuable than a diamond. +If suffering brought wisdom, the dentist's office would be full of luminous ideas. +You don't have to brush your teeth - just the ones you want to keep. +Too many of today's children have straight teeth and crooked morals. +The man with a toothache thinks everyone happy whose teeth are sound. +Dentist: a prestidigitator who, putting metal into your mouth, pulls coin out of your pocket. +I find that most men would rather have their bellies opened for five hundred dollars than have a tooth pulled for five. \ No newline at end of file From 6c50e017a5d81e57534e0246d4eaa862895a3fe4 Mon Sep 17 00:00:00 2001 From: Joe Woods Date: Wed, 7 Oct 2020 20:30:55 +0100 Subject: [PATCH 2/2] inspirational quote --- jarvis.py | 4 ++-- quotes.txt | 30 ------------------------------ 2 files changed, 2 insertions(+), 32 deletions(-) delete mode 100644 quotes.txt diff --git a/jarvis.py b/jarvis.py index c0e77db..616d619 100644 --- a/jarvis.py +++ b/jarvis.py @@ -19,6 +19,7 @@ import os import getpass import random +from quotes import random engine = pyttsx3.init() voices = engine.getProperty('voices') @@ -116,8 +117,7 @@ def screenshot(): img.save('path of folder you want to save/screenshot.png') def inspirational_quote(): - quotes = open('quotes.txt').read().splitlines() - myQuote = random.choice(quotes) + myQuote = random() speak(myQuote) diff --git a/quotes.txt b/quotes.txt deleted file mode 100644 index 6b06f3c..0000000 --- a/quotes.txt +++ /dev/null @@ -1,30 +0,0 @@ -Laugh and the world laughs with you, snore and you sleep alone. -A successful man is one who makes more money than his wife can spend. A successful woman is one who can find such a man. -Roses are red, violets are blue, I'm schizophrenic, and so am I -A woman's mind is cleaner than a man's: She changes it more often. -Behind every great man is a woman rolling her eyes. -People who think they know everything are a great annoyance to those of us who do. -The universe is a big place, perhaps the biggest. -Conscience is a mother-in-law whose visit never ends. -Legend: A lie that has attained the dignity of age. -The only really happy folk are married women and single men. -There is always an easy solution to every problem - neat, plausible, and wrong. -Marriage is a wonderful institution, but who would want to live in an institution? -Strike an average between what a woman thinks of her husband a month before she marries him and what she thinks of him a year afterward, and you will have the truth about him." -An idealist is one who, on noticing that a rose smells better than a cabbage, concludes that it will also make better soup. -A cynic is a man who, when he smells flowers, looks around for a coffin. -If Barbie is so popular, why do you have to buy her friends? -A verbal contract is not worth the paper it's written on. -Facts are stupid things. -I never comment on referees and I'm not going to break the habit of a lifetime for that prat." -Solutions are not the answer. -I knew I was an unwanted baby when I saw that my bath toys were a toaster and a radio. -Happiness is your dentist telling you it won't hurt and then having him catch his hand in the drill. -A dentist at work in his vocation always looks down in the mouth. -Every tooth in a man's head is more valuable than a diamond. -If suffering brought wisdom, the dentist's office would be full of luminous ideas. -You don't have to brush your teeth - just the ones you want to keep. -Too many of today's children have straight teeth and crooked morals. -The man with a toothache thinks everyone happy whose teeth are sound. -Dentist: a prestidigitator who, putting metal into your mouth, pulls coin out of your pocket. -I find that most men would rather have their bellies opened for five hundred dollars than have a tooth pulled for five. \ No newline at end of file