Python, Tkinter and popen problem

MRAB python at mrabarnett.plus.com
Mon Jun 1 14:48:53 EDT 2009


norseman wrote:
> Piet van Oostrum wrote:
>> norseman <norseman at hughes.net> (n) wrote:
[snip]
>>> n> Some questions:
>>> n>     1) "...], stdout=PIPE).stdout
>>> n>                    ^            ^  why the double use?
>>
>> It is not a double use. Popen(["z6.py"], stdout=PIPE) gives you a Popen
>> object, not a file object. If you add .stdout you get the stdout
>> attribute of the Popen object of which you just before stated that it
>> should be a pipe. So the stdout=PIPE parameter makes it create a pipe,
>> and the .stdout returns you that pipe.
>>
> 
> I rather thought it might be something like the military:
> Company - Dress Right - Dress
> Get the attention, state what is to be done, order it done. :)
> 
> Python goes to great lengths to "be helpful" but drops the ball on the 
> obvious.  stdout=PIPE means the user wants stdout piped back so it 
> should be helpful and do the obvious rather than have the user be 
> redundant.
> 
What if the user requests both stdin and stdout? and what about all the
other useful bits which the returned object provides?



More information about the Python-list mailing list