我能够将此代码转换为.exe,但无法运行。 我已经使用cx_Freeze和pyinstaller进行了转换。
import pyttsx3
engine = pyttsx3.init()
voices = engine.getProperty('voices')
engine = pyttsx3.init('sapi5')
engine.setProperty('voice', voices[0].id)
def speak(audio):
engine.say(audio)
engine.runAndWait()
engine.setProperty('rate', 145)
print('Hello sir!')
speak('Hello sir')
print('you can write or paste that you want to listen and press enter. \n')
speak('you can write or paste that you want to listen and press enter. ')
var = str(input('Paste your paragraph here\n:'))
print('Dictating your paragraph....\n\n')
speak(var)
print('Thankyou for using me')
speak('Thankyou for using me!')
engine.runAndWait()
请告诉我该怎么做? 或者自己动手