Re: how to interact with Windows cmd?

2012-09-02 Thread me
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

RE: how to interact with Windows cmd?

2012-07-10 Thread Prasad, Ramit
> 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

Re: how to interact with Windows cmd?

2012-07-05 Thread Nobody
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

how to interact with Windows cmd?

2012-07-04 Thread self.python
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=subprocess.PIPE,shell=True) p=c