I am trying to learn to use espeak and I am following a tutorial, but I am stuck on the very first step. When I try to run this python code:
import subprocess as cmdLine
cmdLine.run("clear")
speech = 'This is what we want espeak to say'
command = 'espeak -x -v ' + 'mb-us1 ' + chr(34) + speech + chr(34)
print (command)
print ("")
All I'm getting is:
PS C:\Users\lukas\New folder> & C:/Users/lukas/AppData/Local/Microsoft/WindowsApps/python3.10.exe "c:/Users/lukas/New folder/hello.py"
Traceback (most recent call last):
File "c:\Users\lukas\New folder\hello.py", line 2, in <module>
cmdLine.run("clear")
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 503, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 971, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1440, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
PS C:\Users\lukas\New folder>
I don't understand what's wrong. All I want is to get cmdLine.run('clear')
to work.