[Tutor] how to get response from os.system()

Luke Paireepinart rabidpoobear at gmail.com
Sun Mar 16 23:13:05 CET 2008


Nathan McBride wrote:
> Would you mind perhaps show an example running an interactive command like su and show how to send input to the commands waiting propmts?
Using the subprocess module, open a command and save the stdin and 
stdout pipes as variables.  Then write to the stdin to send data to the 
program, and read from stdout to get data from it.



More information about the Tutor mailing list