MCPcopy Create free account
hub / github.com/ndleah/python-mini-project / GUI

Class GUI

TextToSpeech/Text_To_Speech.py:6–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4# saytext = input("What should I say? ")
5
6class GUI:
7 def __init__(self):
8 self.root = tk.Tk()
9
10 self.root.title("Text To Speech")
11 self.root.geometry("500x500")
12
13 self.label = tk.Label(self.root, text="Type what you want me to say!", font=('Arial', 16))
14 self.label.pack(padx=10, pady=10)
15
16 self.textbox = tk.Entry(font=('Arial', 16))
17 self.textbox.pack(padx=10, pady=10)
18
19 self.button = tk.Button(text="CLICK ME!", font=('Arial', 16), command=self.button_click)
20 self.button.pack(padx=10, pady=10)
21
22 self.root.mainloop()
23
24 def button_click(self):
25 engine = pyttsx3.init()
26 engine.say(self.textbox.get())
27 engine.runAndWait()
28
29GUI()

Callers 1

Text_To_Speech.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected