Hello, 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:
# based on code from: http://www.daimi.au.dk/~mailund/css/process-management.html # start a bash shell (cin, cout_cerror) = os.popen4("/bin/bash") # write a command on the input pipe of the shell print "writing ls -all!\n\n" cin.write("ls -all") cin.flush() # print the results of my command print cout_cerror.read() Is there something I should be doing differently to get this behavior. Thanks in advance.
_______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
