I want my raspberry pi to speak this print command
print label + " is " + spos + " and the distance is " + str(distance) + "cm"
which has three variables in it. And this is the command i use in shell that i need to use in python
$espeak -s110 "label + " is " + spos + " and the distance is " + str(distance) + "cm"" --stdout | aplay -D sysdefault:CARD=2
I've tried it with os.system because i'm not familiar with subprocess
commands.
os.system('espeak -s110 "'label' + is + 'spos' + and the distance is + 'str(distance)' + cm" --stdout | aplay -D sysdefault:CARD=2')
I'm getting an invalid sytax error. I've tried every version of it and couldn't make it work.
This should give you what you're looking for: