Python makes Windows talk

Speak to me, Windows…

Three lines of code in Python and you are ready to go! The computer tells what you want it to tell. You have to install the win32com modul to take control of Windows. Then you type in this code and have fun. Lot of uses for this, you may agree. We’ve seen another way to make the compueter speak, with gtts, but that is another story.

The code is here… open the cmd and type in python, then…

# Computer speaks
# in Windows

from win32com.client import Dispatch
speak = Dispatch("SAPI.SpVoice")
speak.Speak("Ciao")

 

Published by pythonprogramming

Started with basic on the spectrum, loved javascript in the 90ies and python in the 2000, now I am back with python, still making some javascript stuff when needed.