Running a program from another program.

Laurent Verweijen somelauw at gmail.com
Thu Jun 17 17:40:22 EDT 2010


Op donderdag 17-06-2010 om 14:36 uur [tijdzone -0700], schreef Stephen
Hansen: 
> On 6/17/10 2:09 PM, Laurent Verweijen wrote:
> > It just gives me an empty string.
> > 
> > Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) 
> > [GCC 4.4.3] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> >>>> from asynchronous import *
> >>>> p = Popen(["python", "increment.py"], stdin=PIPE, stdout=PIPE)
> >>>> send_all(p, "5\n")
> >>>> recv_some(p)
> > ''
> >>>> send_all(p, "6\n")
> >>>> recv_some(p)
> > ''
> 
> Yes, that's how it signals the same situation. The point is: your
> subprocess isn't outputting anything. You sure its not crashing out, for
> instance?
> 

No, since it responds to the keyboard:

prompt:~$ python increment.py
05
64
53
44
55
66
75
64
53
44
55
66
7

All output is correct.




More information about the Python-list mailing list