Skip to content

Commit

Permalink
Merge pull request #29 from Pikel1997/main
Browse files Browse the repository at this point in the history
Main file can execute all functions  : Issue #25
  • Loading branch information
Veershah26 committed Oct 12, 2021
2 parents c314b0c + 7bfdcef commit 52ddc5a
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 17 deletions.
24 changes: 23 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
from modules.Apicommand import *
from modules.photo_with_python import *
from modules.ScreenShot import *
from modules.StressBusters import *
from modules.WallpaperScrapper import *
from modules.weather import *
from modules.wiki import *
from modules.YoutubeVideoDownloader import *
import pyttsx3
import datetime
import speech_recognition as sr
Expand Down Expand Up @@ -79,9 +87,23 @@ def takecmdmic():

if __name__ == "__main__":
wishme()
api()
photo_with_python()
StressBusters()
WallpaperScrapper()
#weather function which doesnt work because of non existent api key
# temp()
# detail()
# rain()
# pressure()
# wind()
# humidity()
# clouds()
wiki('Python')
downloadYtMp4('https://www.youtube.com/watch?v=lHhRhPV--G0') #random video to test functionality
while True:
query = takecmdmic().lower()
if 'time' in query:
time()
elif 'date' in query:
date()
date()
3 changes: 2 additions & 1 deletion modules/Apicommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ def api():
except Exception as e:
print(error)

api()
if __name__ == "__main__":
api()
17 changes: 11 additions & 6 deletions modules/ScreenShot.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@

import pyscreenshot
import datetime

image = pyscreenshot.grab()
image.show()
a = datetime.datetime.now()
image.save(f"{a.day,a.month,a.year}.png")


def takescreenshot():
image = pyscreenshot.grab()
image.show()
a = datetime.datetime.now()
image.save(f"{a.day,a.month,a.year}.png")


if __name__ == "__main__":
takescreenshot()
3 changes: 2 additions & 1 deletion modules/StressBusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ def StressBusters():
n.show_toast('StressBusters', choice(messages), duration=10) # 20
tstart = round(time.time())

StressBusters()
if __name__ == "__main__":
StressBusters()
4 changes: 2 additions & 2 deletions modules/YoutubeVideoDownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ def downloadYtMp4(ytURL, dlDir=os.getcwd()):
print("ERROR | Please try again later")
print(f"Donwload Complete | Saved at {os.getcwd()}")


downloadYtMp4("URL")
if __name__ == "__main__":
downloadYtMp4("URL")
13 changes: 13 additions & 0 deletions modules/jokes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from joke.jokes import *
from random import choice
from main import *


def jokes():
random_joke = choice([geek, icanhazdad, chucknorris, icndb])()
# assigning random_joke variable to get random jokes.
speak(random_joke)
# virtual assistant narrating it.


jokes()
7 changes: 3 additions & 4 deletions modules/photo_with_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import cv2




def photo_with_python():
t = datetime.datetime.now()
# Taking a video from the webcam
Expand All @@ -15,11 +13,12 @@ def photo_with_python():
# Giving the camera around 20 frames to adjust to the surroundings for better picture quality
cv2.imwrite(f"{t.second,t.minute,t.hour,t.day,t.month}.png",image)
# As soon as the image is saved we will stop recording
del(camera)
del camera


# Calling the photo_with_python function
photo_with_python()
if __name__ == "__main__":
photo_with_python()

# We need to give some special keyword to this function like click a picture or open camera so the when that's called this function is called

Expand Down
5 changes: 3 additions & 2 deletions modules/wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ def wiki(query):
start="According to Wikipedia"
results=wikipedia.summary(query,sentences=2)
print(start + " " + results)

wiki("query")

if __name__ == "__main__":
wiki("query")

0 comments on commit 52ddc5a

Please sign in to comment.