-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyesbot.py
51 lines (47 loc) · 1.32 KB
/
yesbot.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
#!/usr/bin/env python3
from tkinter import *
from tkinter.font import Font
import pygame.mixer
def sayYes():
yes_s.play()
def key(event):
sayYes()
def shutdown():
sounds.stop()
app.destroy()
app = Tk()
app.title("Yes Bot")
app.geometry('450x120+200+100')
app.resizable(False, False)
myFont = Font(family = "Arial", size = 12)
sounds = pygame.mixer
sounds.init()
yes_s = sounds.Sound("wav/c-falcon_YES.wav")
# You can replace this sound with any other voice saying
# "yes." Be sure to replace the "c-falcon_YES.wav" in this
# line with the new recorded sound file that you saved in
# the wav folder.
# For French speaking telemarketers, say "oui."
# For Spanish speaking telemarketers, say "si."
lab = Label(
app,
text = 'Annoy those telemarketers with one word.',
# French: Agiter les télévendeurs avec un mot.
# Spanish: Molestar a los agentes de telemercadeo con una sola palabra.
height = 3,
font = myFont
)
lab.pack(side = TOP)
btn = Button(
app,
text = "\"Yes\"",
# French: Oui
# Spanish: Si
width = 10,
command = sayYes,
font = myFont
)
btn.pack(side = TOP)
app.bind("<Key>", key)
app.protocol("WM_DELETE_WINDOW", shutdown)
app.mainloop()