I'd like to translate the shell code below to python code.
subprocess.Popen is used for doing it?
I've tried it, but I don't understand how to give (1),(2) commands.
sh> cat a.sh
dc << EOF
20 5 / p --(1)
10 4 * p --(2)
EOF
sh> sh a.sh
4
40
dc is just an example program for asking a question.
This can be replaced with any program which acts like this.
python version is 2.7.6. (Maybe sh module is not included in this version so it seems I can't use sh.Command)