|
|
发表于 2019-10-6 16:49:43
|
显示全部楼层
好了,谢谢!
帮你改进了一下:
- # -*- coding:utf-8 -*-
- from tkinter import *
- from pyttsx3 import init
- from _thread import start_new_thread as s
- def repeat(event=None):
- voice = init()
- voice.say(t.get("0.0", END).replace("\n", ""))
- voice.runAndWait()
- root = Tk()
- root.title("文本复述机")
- Label(root, text="你要复述机为您复述什么?").pack(pady=5)
- t = Text(root, width=30, height=20)
- t.pack(padx=10)
- root.bind("<Control-r>", repeat)
- Button(root, text="复述", width=12, command=repeat).pack(pady=5)
- mainloop()
复制代码 |
|