Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Popen pipe hang

Reply
Thread Tools

Popen pipe hang

 
 
schickb
Guest
Posts: n/a
 
      05-13-2008
I'm trying to pipe data that starts life in an array('B') object
through several processes. The code below is a simplified example. The
data makes it through, but the wait() always hangs. Is there a better
way to indicate src.stdin has reach EOF?

from subprocess import Popen, PIPE
from array import array

arr = array('B')
arr.fromstring("hello\n")

src = Popen( ["cat"], stdin=PIPE, stdout=PIPE)
dst = Popen( ["cat"], stdin=src.stdout)
arr.tofile(src.stdin)
src.stdin.close()
dst.wait()
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Popen: NameError: name 'PIPE' is not defined Mathieu Prevot Python 3 05-24-2008 12:56 PM
popen pipe limit skunkwerk Python 2 04-10-2008 12:54 AM
Re: subprocess.Popen and replacing the shell pipe line jepler@unpythonic.net Python 1 09-23-2005 08:28 AM
subprocess.Popen and replacing the shell pipe line Tom Brown Python 0 09-22-2005 10:38 PM
[named pipe] i wanna know about validate of pipe handle of client lee, wonsun C++ 1 11-02-2004 04:29 AM



Advertisments