I have a python script which calles a bash script.
The bash script compiles several modules and I would like to seethe result of the compilation printed on screen while running.
Most important, anyway, is that the bash script requires a run time quite some few input from the user.
How can I make my python script give stdin/stdout to the bash script?
For the moment I am using
(_stat, _resl) = commands.getstatusoutput("./myBashScript")
but in this way the user is not promped of anything while the bash is running…
Cheers
If you use
subprocess(as you should!) and don’t specify stdin/stdout/stderr, they’ll operate normally. For example:You could also process
stdoutas you like: