-
Notifications
You must be signed in to change notification settings - Fork 1
/
Main.py
68 lines (53 loc) · 1.73 KB
/
Main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# from multiprocessing import Process
from sys import exit as exitPyassist
from sys import platform
import webbrowser
import Help
import Music
import Banner
import Finder
import DailyQuote
import BingWallpaper
plat = None
if platform.startswith('linux'):
plat = 'linux'
elif platform.startswith('win'):
plat = 'windows'
print('\n>>>Welcome to PyAssist<<')
if plat == 'linux':
Banner.showBanner()
print('type "bye" to exit or "help" to print list of commands')
DailyQuote.get_quote()
while(True):
print('>> How can i help you? : ', end='')
query = input().lower().split(' ',1)
if query[0] == 'bye' or query[0] == 'quit' or query[0] == 'exit':
print('Have a nice Day :)')
exitPyassist()
#elif query[0] == 'help':
# Help.helper(query)
elif query[0] == 'g' or query[0] == 'google':
if len(query)>1:
webbrowser.open('http://www.google.com/search?q='+query[1])
else:
webbrowser.open('http://www.google.com/search?q=')
elif query[0] == 'ddg' or query[0] == 'duckduckgo':
if len(query)>1:
webbrowser.open('http://www.duckduckgo.com/'+query[1])
else:
webbrowser.open('http://www.duckduckgo.com/')
elif query[0] == 'find':
Finder.find(query[1],plat)
elif 'run' == query[0] or 'start' == query[0]:
Finder.run(query[1],plat)
elif query[0] == 'open':
Finder.open(query[1],plat)
# pass
elif 'music' in query or 'songs' in query or 'song' in query :
Music.run_query(query,plat)
# elif 'login' in query:
# subprocess.call("%USERPROFILE%\Documents\MyCyberoam.py",shell=True)
elif 'change'==query[0] and 'wallpaper' in query[1].lower():
BingWallpaper.get_Wallpaper(plat)
else:
print('Unrecognized command. please consider improving me.')