Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何运行这个命令:
espeak -v mb-en1 "hello world"
这在 Linux Mint 终端中有效,但在 Python 程序中如何呢?
感谢您的任何建议
最后一分钟的变化:
我最近设法以这种方式工作:
import os text = "hello world" os.system('espeak -v mb-en1 text')
但我需要阅读变量的内部,而不是说“文本”
有什么建议么?
说真的,抬头看看python subprocess。只是
python subprocess
import subprocess text = "hello world" subprocess.Popen(["espeak", "-v", "mb-en1", text])
import os os.system("espeak -v mb-en1 "hello world")
应该管用。