EOFError: EOF when reading a line

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu Mar 11 20:22:51 EST 2010


En Thu, 11 Mar 2010 06:12:02 -0300, Mihir Patel <mihir3445 at gmail.com>  
escribió:

> I am trying to use the subprocess to send the data to child process. I
> am not sure why i keep getting  "EOFError: EOF when reading a line"
>
> command_line = 'python test_input.py'
> p =subprocess.Popen(command_line, shell=True, stdin=subprocess.PIPE,
> stdout=subprocess.PIPE)
> print 'output:', p.communicate()[0]
>
> o,e = p.communicate('test')

You may call communicate at most once.

-- 
Gabriel Genellina




More information about the Python-list mailing list