<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 28/03/2014 06:35 pm, Josiah Carlson
wrote:<br>
</div>
<blockquote
cite="mid:CADcB0yix8abmQ2_0NLatt-VdVOnsbk_Zn6ByLR0vWiUHxgTfOg@mail.gmail.com"
type="cite">
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div>If it were me, I'd define three methods, with longer
names to clarify what they do, e.g.<br>
<br>
proc.write_nonblocking(data)<br>
</div>
<div>data = proc.read_nonblocking()<br>
data = proc.read_stderr_nonblocking()<br>
</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>Easily doable.</div>
</blockquote>
To implement write_nonblocking() on Windows, do you intend to use
SetNamedPipeHandleState() with PIPE_NOWAIT? The documentation
discourages using this:<br>
<br>
<meta charset="utf-8">
<span style="color: rgb(69, 69, 69); font-family: 'Segoe UI',
'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size:
14px; font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 20.006000518798828px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline
!important; float: none;"> Note that nonblocking mode is
supported for compatibility with<br>
Microsoft LAN Manager version 2.0 and should not be used to<br>
achieve asynchronous input and output (I/O) with named pipes.</span><br>
<br>
And I guess you will need to use a poll/sleep loop to simulate
blocking or multiplexing. If you want expect-like behaviour then
you need some sort of multiplexing.<br>
<br>
-- RIchard<strong style="color: rgb(42, 42, 42); font-family: 'Segoe
UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;
font-size: 14px; font-style: normal; font-variant: normal;
letter-spacing: normal; line-height: 20.005998611450195px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;"></strong>
</body>
</html>