Not sure but have you tried using functions from the os library? For example
you could use execl() to execute your commands and pipe the output
somewhere-stdin in your case.
--
http://mail.python.org/mailman/listinfo/python-list
> what I want to do is
> 1.open cmd
> 2.waiting for user's typing
> 3.when I type "dir"
> 4.print the result of "dir"
> 5.then I type some other commands, printing the result until I type
> 'exit'
>
> I used
> p=subprocess.Popen('cmd',stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=s
> ubproce
On Wed, 04 Jul 2012 20:10:47 -0700, self.python wrote:
> 2. after this, I typed like "cd .." but I/O is already closed so I
> can't do another things..
Don't use .communicate() if you want to keep the child process alive.
Write to p.stdin and read p.stdout and p.stderr.
In general, you'll need t