On 5/5/2015 10:59 PM, Guido van Rossum wrote:
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.

After redirection from googlecode tulip, I found
https://github.com/python/asyncio/tree/master/examples
None of the 4 *process*.py examples mention tkinter.

I also found "Create a Tkinter/Tulip integration"
https://github.com/python/asyncio/issues/21
with attachment tk_ayncio.zip
copied (with 'async' replacing 'tulip') to
https://bitbucket.org/haypo/asyncio_staging/src/bb76064d80b0a03bf3f7b13652e595dfe475c7f8/asyncio_tkinter/?at=default

None of the integration files mention subprocess, so I presume you are suggesting that I use a modification of one of the example subprocess coroutines with the integration framework.

If this works well, might it make sense to consider using an elaboration of examples/subprocess_shell.py to replace subprocess socket communication with pipe comminication?

On Tue, May 5, 2015 at 6:03 PM, Terry Reedy <tjre...@udel.edu
<mailto:tjre...@udel.edu>> wrote:

    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.)

    async def menu_handler()
         ow = OutputWindow(args)  # tk Widget
         proc = subprocess.Popen (or multiprocessing equivalent)
         out = (stdout from process)
         await for line in out:
             ow.write(line)
         finish()

    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?

--
Terry Jan Reedy

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to