[Tutor] Writing a script to interact with an interactive command program
demonic.software at gmail.com
Tue Jun 10 00:19:06 CEST 2008
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:
# 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"
# print the results of my command
Is there something I should be doing differently to get this behavior.
Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor