I have a code that run with this command
echo "my string" | my_program.sh
and I was wondering what's the best way to do this inside a python script.
What I have for now is this
import os
my_string = "my string"
os.system('echo %s | my_program.sh' % my_string)
which seems a very dirty solution. Is there a more pythonic way of doing the same thing?