Hello,<br><br>I am trying to write an interactive shell that will pipe input from one source to a shell/program, and then return the input to that source. I have been trying to do this with the os.popen*, and I have not had any success in getting this to work. Here is a basic piece of the code that demonstrates what I am trying to do:<br>
<br><br># based on code from: <a href="http://www.daimi.au.dk/~mailund/css/process-management.html">http://www.daimi.au.dk/~mailund/css/process-management.html</a><br># start a bash shell<br>(cin, cout_cerror) = os.popen4("/bin/bash")<br>
<br># write a command on the input pipe of the shell<br>print "writing ls -all!\n\n" <br>cin.write("ls -all")<br>cin.flush()<br><br># print the results of my command<br>print cout_cerror.read()<br><br>
<br>Is there something I should be doing differently to get this behavior. Thanks in advance.<br><br><br><br>