<div dir="ltr">For this you should probably use an integration of asyncio (which can do async subprocess output nicely) with Tkinter. Over in tulip-land there is an demo of such an integration.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 5, 2015 at 6:03 PM, Terry Reedy <span dir="ltr"><<a href="mailto:tjreedy@udel.edu" target="_blank">tjreedy@udel.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 5/5/2015 6:25 PM, Yury Selivanov wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Yes, there is no other popular event loop for 3.4 other<br>
than asyncio,<br>
</blockquote>
<br></span>
There is the tk(inter) event loop which also ships with CPython, and which is commonly used.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
that uses coroutines based on generators<br>
</blockquote>
<br></span>
Oh ;-) Tkinter event loop is callback based. AFAIK, so is the asyncio event loop, but that is somehow masked by tasks that interface to coroutines. Do you think the 'somehow' could be adapted to work with the tkinter loop?<br>
<br>
What I do not understand is how io events become event loop Event instances. For tk, keyboard and mouse actions seen by the OS become tk Events associated with a widget. Some widgets generate events. User code can also generate (pseudo)events.<br>
<br>
My specific use case is to be able to run a program in a separate process, but display the output in the gui process -- something like this (in Idle, for instance). (Apologies if this misuses the new keywords.)<br>
<br>
async def menu_handler()<br>
ow = OutputWindow(args) # tk Widget<br>
proc = subprocess.Popen (or multiprocessing equivalent)<br>
out = (stdout from process)<br>
await for line in out:<br>
ow.write(line)<br>
finish()<br>
<br>
I want the handler to not block event processing, and disappear after finishing. Might 492 make this possible someday? Or would having 'line in pipe' or just 'data in pipe' translated to a tk event likely require a patch to tk?<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Terry Jan Reedy</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/guido%40python.org" target="_blank">https://mail.python.org/mailman/options/python-dev/guido%40python.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div>