I want to print a line before it is spoke. When I run the program in IDLE, it works fine. But after compilation, the text is spoke first and then printed. Can anyone help me with it?
I tried different ways to type the same code but it didn't work.
import pyttsx3
engine = pyttsx3.init()
engine.setProperty('rate', 150)
engine.setProperty('volume', 1)
def say(y):
print(y, end='')
engine.say(y)
engine.runAndWait()
say('Hello World')
I want to print a line before it is spoke but it is always spoke first after compilation.