NEWBIE: Extending Python with C

Wolfgang Strobl wks000 at t-online.de
Sun Nov 10 15:24:19 EST 2002


Alex Martelli <aleax at aleax.it>:

>Wolfgang Strobl wrote:
>
>> Alex Martelli <aleax at aleax.it>:
>> 
>>>This is more or less the end of the line in terms of what
>>>os.popen can offer -- due to buffering and suchlike there's
>>>no practical way for python to drive BOTH standard input
>>>and standard-output of another external program.
>> 
>> Well, the following snippet, driving nslookup.exe on W2K works for me:
>
>So nslookup.exe on W2K does no more than line-buffering on its output, and 
>reads its input repeatedly, too.  Bully for it (for the sole purpose of 
>controlling both its stdin and stdout with pipes).  

Norm (engsol at teleport.com) wrote "I'm using Python 222 on NT".

Using nslookup (for example) through a pair of pipes works quite well
on NT. One should'nt dismiss the possibility of controlling an external
line mode program trough pipes so quickly, IMHO. That's my point.

>Most programs aren't as 
>skittish with their stdin and stdout once they determine they aren't 
>terminals.  

It comes somewhat of a surprise to me that the concept of byte streams,
pipes and filters works better on NT than on Linux, in this specific
example.


-- 
Wir danken für die Beachtung aller Sicherheitsbestimmungen



More information about the Python-list mailing list