Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
import os     


if __name__ == '__main__':
        x = input("What you want me to pronounce")  
        command = f"say {x}"
        os.system(command) 

#can I run this on windows or it can be run on MAc only

What I have tried:

checking whether the above code is runnable on windows or not
Posted
Updated 9-Apr-23 4:11am

1 solution

There is no "say" command on Windows, so no, as it, that code will not work.

All that code does is send a command to the command shell.

On a Mac, you can try this yourself. Open a Terminal window and type "say This is a test".
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900