Daniel Dcs
Daniel Dcs

Reputation: 37

Operate - espeak -v mb-en1 "hello world" - in Python

how I can run this command:

espeak -v mb-en1 "hello world"

this works in Linux Mint terminal but how would this in a Python program?

thanks for any suggestions

last minute change:

I recently managed to work this way:

import os

text = "hello world"

os.system('espeak -v mb-en1 text')

but I need to read the inside of the variable, not to say "text"

Any suggestions?

Upvotes: -1

Views: 868

Answers (2)

Veedrac
Veedrac

Reputation: 60207

Seriously, just look up python subprocess. It's just

import subprocess

text = "hello world"
subprocess.Popen(["espeak", "-v", "mb-en1", text])

Upvotes: 2

Groditz
Groditz

Reputation: 115

import os
os.system("espeak -v mb-en1 "hello world")

should work.

Upvotes: -1

Related Questions