Skip to content

Instantly share code, notes, and snippets.

@Madwolf2007
Created June 10, 2021 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Madwolf2007/8f130bf0bb90d5bc5394235baba53d24 to your computer and use it in GitHub Desktop.
Save Madwolf2007/8f130bf0bb90d5bc5394235baba53d24 to your computer and use it in GitHub Desktop.
import webbrowser as wb
import sys
import os
import datetime as dt
import subprocess as sb
import tkinter as tk
import time
import signal
import getpass as gp
import calendar
import email
import smtplib as sl
import smtpd
import json
import winsound
import random
import pyttsx3
import win10toast
import smtplib
import ssl
import tweepy
from win10toast import ToastNotifier
from urllib.request import urlopen
dt = dt.datetime.now()
words = ["google", "search", "browse the net for", "look up"]
Opening_message = "What's up?"
engine = pyttsx3.init()
only_time = dt.now().strftime("%H-%M-%S")
only_date = dt.now().strftime("%d-%m-%Y")
auth = tweepy.OAuthHandler("Twitter auths")
auth.set_access_token("access tokens")
notif = ToastNotifier()
port = 587
api = tweepy.API(auth)
smtp_server = "smtp.gmail.com"
edadaiugdaiugdaiugda = open("mydmus1.txt", "w")
edadaiugdaiugdaiugda.close()
f = open("mydmus1.txt", "r")
email = f.read()
f.close()
pswv = 0
print(Opening_message)
engine.say(Opening_message)
engine.runAndWait()
gfigfdu = 1
while gfigfdu == 1:
q = input(">>>")
if q in ["What can you do?", "what can you do", "what can you do?", "What can you do"]:
print("I can do lots of diffrent things, for example you can say:")
engine.say("I can do lots of diffrent things, for example you can say")
engine.runAndWait()
print("What's the time?;")
engine.say("What's the time?")
engine.runAndWait()
print("Open YouTube;")
engine.say("Open YouTube")
engine.runAndWait()
print("Set a reminder;")
engine.say("Set a reminder")
engine.runAndWait()
print("Let's play a game;")
engine.say("Let's play a game")
engine.runAndWait()
print("Open a Website;")
engine.say("Open a Website")
engine.runAndWait()
print("I'd like to change my email;")
engine.say("I'd like to change my email")
engine.runAndWait()
print("And much more!")
engine.say("And much more!")
engine.runAndWait()
elif q in ["whats the time?", "whats the time", "What is the time?", "What's the time?", "what is the time", "what is the time?"]:
print(only_time)
engine.say(only_time)
engine.runAndWait()
elif q in ["tweet", "Tweet"]:
engine.say("What to tweet?")
engine.runAndWait()
print("What to tweet?")
twt = input(">>>")
api.update_status(twt)
elif q in ["whats the date?", "whats the date", "What is the date?", "What's the date?", "what is the date", "what is the date?"]:
print(only_date)
engine.say(only_date)
engine.runAndWait()
elif q in ["Send an email", "send email", "send an email", "send mail", "send a mail"]:
engine.say("What's the password for your email address? ")
engine.runAndWait()
print("What's the password for " + email + "?")
password = input(">>>")
engine.say("to whom?")
engine.runAndWait()
receiver_email = input("Receiver address: ")
subjectc = input("Subject: ")
subject = "Subject:" + subjectc
content = input("Content: ")
message = subject + "\n" + content
context = ssl.create_default_context()
with smtplib.SMTP(smtp_server, port) as server:
server.ehlo()
server.starttls(context = context)
server.ehlo()
server.login(str(email), str(password))
server.sendmail(email, receiver_email, message)
elif q in ["Set reminder", "Set a reminder", "set a reminder", "set reminder"]:
print("What shall I remind you about?")
engine.say("What shall I remind you about?")
engine.runAndWait()
text = str(input(">>>"))
print("In how many minutes?")
engine.say("In how many minutes?")
engine.runAndWait()
local_time = float(input(">>>"))
local_time = local_time * 60
engine.say("Don't close the program!")
engine.runAndWait()
time.sleep(local_time)
notif.show_toast("Reminder!", text, threaded = True, icon_path = "none", duration = 0)
print(text)
engine.say(text)
engine.runAndWait()
time.sleep(0.5)
elif q in ["Let's play a game", "lets play a game", "Lets play a game", "im bored", "I'm bored", "I am bored", "i am bored", "I dunno", "i dunno", "boredom", "Boredom"]:
print("Do you want to play a game?")
engine.say("Do you want to play a game?")
engine.runAndWait()
yon = input(">>>")
if yon == "yes" or "Yes":
num = random.randint(1,20)
engine.say("Ok, guess the number from 1 to 20")
engine.runAndWait()
at = int(input("Ok, Guess the number from 1 to 20: "))
while at != num:
if at < num:
print("That's too small")
engine.say("that's too small")
engine.runAndWait()
elif at > num:
print("That's too big")
engine.say("that's too big")
engine.runAndWait()
at = int(input("Retry: "))
print("Correct")
engine.say("correct")
engine.runAndWait()
elif q in ["email", "whats my email", "what is my email address", "What's my email address", "What's my email?"]:
print("Your email is " + email)
engine.say("Your email is " + email)
engine.runAndWait()
elif q in ["open unity", "Open Unity", "Open unity", "open Unity", "open Unity Hub", "open unity hub", "Open unity hub", "Open Unity Hub", "Open Unity hub"]:
print(" ")
print("Opening Unity Hub...")
engine.say("Opening unity hub")
engine.runAndWait()
time.sleep(2)
os.startfile("C:\\Program Files\\Unity Hub\\Unity hub")
elif q in ["I'd like to change my email", "i would like to change my email", "email change", "I'd like to change my email address", "change my email", ]:
engine.say("What do you want to change your email address to?")
t = open("mydmus1.txt", "w")
print("What do you want to change your email address to? ")
engine.runAndWait()
email = input(">>>")
t.write(email)
t.close()
elif q in ["open maps", "Open Maps", " Open Google Maps", "Open maps", "open google maps"]:
print(" ")
print("Opening Google Maps...")
engine.say("opening google maps")
engine.runAndWait()
time.sleep(2)
wb.open('https://maps.google.com/')
elif q in ["open messages", "Open Messages", "Open messages", "open Messages"]:
print(" ")
print("Opening Google Messages...")
engine.say("opening google messages")
engine.runAndWait()
time.sleep(2)
wb.open('https://messages.google.com/web')
elif q in ["Open a website", "open a website", "Open a Website", "open a website"]:
engine.say("What's the name of the web site")
print("Type the name of the wesite (example.com)")
engine.runAndWait()
w = input(">>>")
print(" ")
print("Opening " + w + "...")
engine.say("opening" + w)
engine.runAndWait
wb.open("https://" + w)
elif q in ["open wikipedia", "open Wikipedia", "Open Wikipedia", "Open wikipedia", "open wiki", "Open wiki", "Open Wiki", "open Wiki"]:
print(" ")
print("Opening Wikipedia...")
engine.say("opening wikipeia")
engine.runAndWait()
time.sleep(2)
wb.open('https://en.wikipedia.org/wiki/Main_Page')
elif q in ["Add", "add"]:
engine.say("which 2 number to add up")
print("Which 2 numbers to add up?")
engine.runAndWait()
first = int(input("1st one> "))
second = int(input("2nd one> "))
print(first + second)
elif q in ["subtract", "Subtract"]:
engine.say("which 2 numbers to subtract from each other")
print("Which 2 numbers to subtract?")
engine.runAndWait()
first = int(input("1st one> "))
second = int(input("2nd one> "))
print(first - second)
elif q in ["Multiply", "multiply"]:
engine.say("which 2 numbers to multiply")
print("Which 2 numbers to multiply?")
engine.runAndWait()
first = int(input("1st one> "))
second = int(input("2nd one> "))
print(first * second)
elif q in ["Divide", "divide"]:
engine.say("which 2 numbers to divide")
print("Which 2 numbers to divide?")
engine.runAndWait()
first = int(input("1st one> "))
second = int(input("2nd one> "))
print(first / second)
elif q in ["open", "Open"]:
engine.say("what do you want me to open")
print("What do you want me to open?")
engine.runAndWait()
o = input(">>>")
if o in ["youtube", "YouTube", "Youtube", "youTube"]:
print(" ")
print("Opening YouTube...")
time.sleep(2)
wb.open('https://www.youtube.com/')
elif o in ["unity", "Unity", "Unity Hub", "Unity hub", "unity hub", "unity Hub"]:
print(" ")
print("Opening Unity Hub...")
time.sleep(2)
os.startfile("C:\\Program Files\\Unity Hub\\Unity hub")
elif o in ["maps", "Maps", "Google Maps", "Google Maps", "google maps"]:
print(" ")
print("Opening Google Maps...")
time.sleep(2)
wb.open('https://maps.google.com/')
elif o in ["messages", "Messages", "Google messages", "Google Messages"]:
print(" ")
print("Opening Google Messages...")
time.sleep(2)
wb.open('https://messages.google.com/web')
elif o in ["a website", "A website", "Website", "website"]:
print("Type the name of the wesite (example.com)")
w = (">>>")
print(" ")
print("Opening your website...")
time.sleep(2)
wb.open("https://" + w)
elif o in ["wikipedia", "Wikipedia", "wiki", "Wiki"]:
print(" ")
print("Opening Wikipedia...")
time.sleep(2)
wb.open('https://en.wikipedia.org/wiki/Main_Page')
else:
engine.say("searching the internet for" + q)
engine.runAndWait()
wb.open("https://www.google.com/search?q=" + q + "&oq=" + q + "&aqs=chrome..69i57.6936j0j9&sourceid=chrome&ie=UTF-8")
elif q in words:
if "google" in q:
wbs = q.replace("google", "")
wb.open("https://www.google.com/search?q=" + wbs + "&oq=" + wbs + "&aqs=chrome..69i57.6936j0j9&sourceid=chrome&ie=UTF-8")
elif "search" in q:
wbs = q.replace("search", "")
wb.open("https://www.google.com/search?q=" + wbs + "&oq=" + wbs + "&aqs=chrome..69i57.6936j0j9&sourceid=chrome&ie=UTF-8")
elif "look up" in q:
wbs = q.replace("look up", "")
wb.open("https://www.google.com/search?q=" + wbs + "&oq=" + wbs + "&aqs=chrome..69i57.6936j0j9&sourceid=chrome&ie=UTF-8")
else:
engine.say("searching the internet for" + q)
engine.runAndWait()
wb.open("https://www.google.com/search?q=" + q + "&oq=" + q + "&aqs=chrome..69i57.6936j0j9&sourceid=chrome&ie=UTF-8")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment