How would I do a continuous write over a pipe in the following code...

Chris Rebert clp2 at rebertia.com
Sun Feb 21 16:18:28 EST 2010


On Sun, Feb 21, 2010 at 1:09 PM, Dennis Lee Bieber
<wlfraed at ix.netcom.com> wrote:
> On Sat, 20 Feb 2010 12:46:24 -0800 (PST), chad <cdalten at gmail.com>
> declaimed the following in comp.lang.python:
>
>> Given the following....
>>
>> #!/usr/bin/python
>>
>> import subprocess as s
>>
>> broadcast = s.Popen("echo test | wall", shell=True,stdout=s.PIPE)
>>
>> out = broadcast.stdout
>> while 1:
>>     out
>
>        Does nothing... "out" is a name bound to the object identified by
> "broadcast.stdout"...
>
>        It does nothing unless it is called as...
>
>        out(somedata)

I'm pretty sure you meant:

out.write(somedata)

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list