Espeak 在 windows 7 和 python 2.7

Espeak on windows 7 and python 2.7

一开始我会说这里有一个类似的 post:How to use espeak with python 我使用了这个 post 的答案,但我仍然遇到错误,所以也许你能帮我解决它。

import subprocess
text = '"Hello world"'
subprocess.call('espeak '+text, shell=True)

这段代码给我一个错误:

'espeak' is not recognized as an internal or external command,
operable program or batch file.

ps。我想我正确安装了 espeak,因为我可以在 CMD 行中使用:

espeak "text"

它会正确地说 "text"。

PS2。这个问题的答案可能就是我之前 post 编辑的另一个问题的答案。 ()

import subprocess
subprocess.call(['ping', '127.0.0.1'], shell=True)