-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathGETO.py
More file actions
178 lines (172 loc) · 7.02 KB
/
GETO.py
File metadata and controls
178 lines (172 loc) · 7.02 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
import tkinter
import webbrowser
import random
import speech_recognition as sr
print('Greetings to you Boss \nI\'m your GETO \nwhat you want me to do?:\n\n-Games \n-Entertainment \n-Translate \n-Others');
i =(input('\nEnter the option you want: '))
if (i.upper()=="GAMES"):
root = tkinter.Tk()
root.title("GAME: ROCK - PAPER -SCISSORS by tp-21-june-py-4")
root.geometry("400x500")
random_number = random.randint(1, 3)
if random_number == 1:
GETO_choice = "R"
elif random_number == 2:
GETO_choice = "P"
elif random_number == 3:
GETO_choice = "S"
rock_image = """
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)"""
paper_image = """
_______
---' ____)____
______)
_______)
_______)
---.__________)"""
scissors_image = """
_______
---' ____)____
______)
__________)
(____)
---.__(___)"""
def rock():
label_my_choice['text'] = rock_image
if GETO_choice == "R":
label_result['text'] = "TIE"
label_GETO_choice['text'] = rock_image
elif GETO_choice == "P":
label_result['text'] = "GETO wins!"
label_GETO_choice['text'] = paper_image
elif GETO_choice == "S":
label_result['text'] = "Congratulations, you win!"
label_GETO_choice['text'] = scissors_image
def paper():
label_my_choice['text'] = paper_image
if GETO_choice == "P":
label_result['text'] = "TIE"
label_GETO_choice['text'] = paper_image
elif GETO_choice == "S":
label_result['text'] = "GETO wins!"
label_GETO_choice['text'] = scissors_image
elif GETO_choice == "R":
label_result['text'] = "Congratulations, you win!"
label_GETO_choice['text'] = rock_image
def scissors():
label_my_choice['text'] = scissors_image
if GETO_choice == "S":
label_result['text'] = "TIE"
label_GETO_choice['text'] = scissors_image
elif GETO_choice == "R":
label_result['text'] = "GETO wins!"
label_GETO_choice['text'] = rock_image
elif GETO_choice == "P":
label_result['text'] = "Congratulations, you win!"
label_GETO_choice['text'] = paper_image
def reset():
global GETO_choice
random_number = random.randint(1, 3)
if random_number == 1:
GETO_choice = "R"
elif random_number == 2:
GETO_choice = "P"
elif random_number == 3:
GETO_choice = "S"
label_GETO_choice['text'] = " "
label_result['text'] = "Waiting for your input..."
button_rock = tkinter.Button(root, text="Rock", command=rock)
button_rock.pack()
button_paper = tkinter.Button(root, text="Paper", command=paper)
button_paper.pack()
button_scissors = tkinter.Button(root, text="Scissors", command=scissors)
button_scissors.pack()
label_GETO_choice = tkinter.Label(root, justify=tkinter.LEFT, font="Courier", text="")
label_GETO_choice.pack()
label_my_choice = tkinter.Label(root, justify=tkinter.LEFT, font="Courier", text="")
label_my_choice.pack()
label_result = tkinter.Label(root, text="Waiting for your input...")
label_result.pack()
button_reset = tkinter.Button(root, text="Play Again", command=reset)
button_reset.pack()
root.mainloop()
elif (i.upper() == "ENTERTAINMENT"):
print(
"Hurray..!! it's chilling time...\nClick |1| to open Netflix \nClick |2| to open AmazonPrimeVideo \nClick |3| to open Hotstar \nClcik |4| to open YouTube \nClick |5| to open Spotify \nClick |6| to open Gaana '")
Click = int(input('So,what you want me to open:'))
while Click > 6 or Click < 0:
Click = int(input(
'Invalid Click, Please try entering based on the following instructions: \nClick |1| to open Netflix \nClick |2| to open AmazonPrimeVideo \nClick |3| to open Hotstar \nClcik |4| to open YouTube \nClick |5| to open Spotify \nClick |6| to open Gaana '))
if (Click == 1):
url = 'https://' + 'www.netflix.com'
webbrowser.open(url)
elif (Click == 2):
url = 'https://' + 'www.primevideo.com'
webbrowser.open(url)
elif (Click == 3):
url = 'https://' + 'www.hotstar.com'
webbrowser.open(url)
elif (Click == 4):
url = 'https://' + 'www.youtube.com'
webbrowser.open(url)
elif (Click == 5):
url = 'https://' + 'www.spotify.com'
webbrowser.open(url)
else:
url = 'https://' + 'www.gaana.com'
webbrowser.open(url)
elif (i.upper() == "TRANSLATE"):
r = sr.Recognizer()
with sr.Microphone() as source:
print("Hello Boss..!!, Start speaking now...")
audio = r.listen(source)
try:
text = r.recognize_google(audio)
print("Did you say? {}".format(text))
except:
print("Coudn't recognize your voice, Try again")
elif (i.upper() == "OTHERS"):
print("Hello Boss,\nOther consists of: \n-Social Media \n-NEWS")
O = input("What you want to open in others:")
if (O.upper() == "SOCIALMEDIA"):
print(
"---Social Media and communication---\nClick |1| to open FaceBook \nClick |2| to open Twitter \nClick |3| to open Instagram \nClcik |4| to open LinkedIn")
Click = int(input('So,what you want me to open:'))
while Click > 4 or Click < 1:
Click = int(input(
'Invalid Click, Please try entering based on the following instructions:\nClick |1| to open FaceBook \nClick |2| to open Twitter \nClick |3| to open Instagram \nClcik |4| to open LinkedIn '))
if (Click == 1):
url = 'https://' + 'www.facebook.com'
webbrowser.open(url)
elif (Click == 2):
url = 'https://' + 'www.twitter.com'
webbrowser.open(url)
elif (Click == 3):
url = 'https://' + 'www.instagram.com'
webbrowser.open(url)
else:
url = 'https://' + 'www.linkedin.com'
webbrowser.open(url)
elif (O.upper() == "NEWS"):
print(
"---Popular NEWS Sites---\nClick |1| to open Times of India \nClick |2| to open The Hindu \nClick |3| to open Inshorts")
Click = int(input('So,what you want me to open:'))
while Click > 3 or Click < 1:
Click = int(input(
'Sorry Boss the entered option is invalid, Please try entering:\nClick |1| to open Times of India \nClick |2| to open The Hindu \nClick |3| to open Inshorts\n'))
if (Click == 1):
url = 'https://' + 'www.timesofindia.com'
webbrowser.open(url)
elif (Click == 2):
url = 'https://' + 'www.thehindu.com'
webbrowser.open(url)
else:
url = 'https://' + 'www.Inshorts.com'
webbrowser.open(url)
else:
print("\n------- ERROR 404 -------- \nRun Again and Try \n\n-Games \n-Entertainment \n-Translate \n-Others")