[issue27546] Integrate tkinter and asyncio (and async)

2022-04-05 Thread Terry J. Reedy
Terry J. Reedy added the comment: I posted look_tk3, I believe, as an answer to an SO question. https://stackoverflow.com/questions/47895765/use-asyncio-and-tkinter-or-another-gui-lib-together-without-freezing-the-gui/47896365#47896365 -- ___

[issue27546] Integrate tkinter and asyncio (and async)

2022-04-04 Thread Skip Montanaro
Change by Skip Montanaro : -- nosy: -skip.montanaro ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27546] Integrate tkinter and asyncio (and async)

2022-04-04 Thread Skip Montanaro
Skip Montanaro added the comment: See also (perhaps) https://bugs.python.org/issue47190 -- nosy: +skip.montanaro ___ Python tracker ___

[issue27546] Integrate tkinter and asyncio (and async)

2018-05-14 Thread Alex Walters
Change by Alex Walters : -- nosy: +tritium ___ Python tracker ___ ___

[issue27546] Integrate tkinter and asyncio (and async)

2017-06-29 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: -pitrou ___ Python tracker ___ ___ Python-bugs-list

[issue27546] Integrate tkinter and asyncio (and async)

2017-06-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: If you're interesting in this, you should take a look at what Twisted has done, since they have a history of integrating with various GUI toolkits. You'll find everything in the "twisted.internet" package:

[issue27546] Integrate tkinter and asyncio (and async)

2017-06-28 Thread Tamás Bajusz
Changes by Tamás Bajusz : -- nosy: +gbtami ___ Python tracker ___ ___ Python-bugs-list

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-26 Thread Guido van Rossum
Guido van Rossum added the comment: OK, in the context of IDLE it probably doesn't matter (though I recall that IDLE was given a hard time many years ago by people complaining about that same busy-waiting -- I guess batteries have improved somewhat since then). --

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-26 Thread Yury Selivanov
Yury Selivanov added the comment: > A proper solution IMO should somehow merge the selectors so that a > single select() or whatever wakes up when either network I/O happens > or a UI event comes in (which could be something that Tk transparently > handles but it still needs to be given the

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: > wasting battery power ?! We live in slightly different computing universes > ;-). But I get the point. The last two files I uploaded use call_later and > I should stick with that. I should also add a note that the innermost > asyncio loop function

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: This afternoon, I realized that I would replace the async for loops with while loops with await sleep and eliminate the Timer class. I presume the tutorial will have other examples of how to write an async iterator. (If not, I would put is back in.) I also

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-26 Thread Guido van Rossum
Guido van Rossum added the comment: Isn't this going to busy-wait, esp. with the loop.call_soon() version? Even with loop.call_later(0.1, tk_update) you're wasting battery power even if no network activity and no UI activity is happening. I'm not eager to document this as the right way to do

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: [On #27579, Lodovic Gasc volunteered to open and help with an issue on the github asyncio-doc project.] Ludovic, here is my current suggestion for the asyncio tutorial or how-to. Adding a Tkinter GUI to an Asyncio Program

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: I was thinking of starting (Mon. afternoon/evening, its now 2:40 am) with updating done stats with every done fetcher, updating stat display every second, and listing urls with html body, with a way to view the body. Log to text easy too. Table of

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-24 Thread Guido van Rossum
Guido van Rossum added the comment: Oh, my tkinter.TkVersion is 8.6. -- ___ Python tracker ___ ___

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-24 Thread Guido van Rossum
Guido van Rossum added the comment: PS. I recommend this command line to play with tkcrawl.py: python3 tkcrawl.py xkcd.com -q The fetching process takes about 6.8 seconds to fetch 1765 URLs on my machine. The original crawl.py takes 6.2 seconds. I guess the next step would be to hook up the

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-24 Thread Guido van Rossum
Guido van Rossum added the comment: OK, I'm playing with this too. I merged your loop_tk.py example with crawl.py and am attaching the result as tkcrawl.py. I don't like global state so I added root and loop as parameters to a few places. Hopefully you have the asyncio repo checked out so you

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: Windows 10, repository default (3.6), with tcl/tk 8.6.4. I am not sure what to make of your results. I have an impression that tk on Mac was considerably rewritten for 8.6. Ned would know more about that. Which were you using? "print(tkinter.TkVersion)"

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-24 Thread Guido van Rossum
Guido van Rossum added the comment: On what platform did you measure that? On a Mac, with Python 3.5.2, I get very different numbers: tkloop: 9000/sec asloop: 9/sec (about 10x!) tkasyncloop: 2500/sec -- ___ Python tracker

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: Speed tests: First -- raw loops/second. The attached loopspeed.py has code for tk and asyncio that is equivalent as I know how. The tkasync loop is for the asyncio loop with a root.update() call added, where the root is a fresh instance of Tk(). (Reusing

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: Using the callback loop from loop_tk.py, 3.6 repository IDLE runs with an asyncio loop. See idle-async.diff. So far, it seems about as snappy. I need to do a more stressful (longer running) gui operation test to be sure: change syntax highlighting with 10

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: New file loop_tk.py solve the responsiveness problem, at least for this example, by using the asyncio loop as it is and doing tk updates in a callback loop. It works with both SelectorEventLoop and ProactorEventLoop. I was inspired to try this, instead of my

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-21 Thread Guido van Rossum
Guido van Rossum added the comment: > Who actually wrote it [crawl.py], that would understand it? I wrote it, and I can probably still recover my understanding of it. Basically you say "python3 crawl.py xkcd.com -q" and it crawls the XKCD.com website -- that takes about 4 seconds on my

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: Guido, that seems like a reasonable roadmap. The examples directory is not in the CPython repo, but I found it here. https://github.com/python/asyncio/tree/master/examples For a demo based on crawl.py, the goal would be a live status report. Perhaps as

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-18 Thread Maxime S
Maxime S added the comment: I've signed the CLA. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-17 Thread Guido van Rossum
Guido van Rossum added the comment: I expect it should eventually be added to tkinter. But I also think it might be worthwhile to first develop it as a 3rd party package on PyPI, to see if it can actually be done well enough to put it in the stdlib. I guess a demo app should be part of the

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-17 Thread Terry J. Reedy
Changes by Terry J. Reedy : Added file: http://bugs.python.org/file43770/tkloop.py ___ Python tracker ___

[issue27546] Integrate tkinter and asyncio (and async)

2016-07-17 Thread Terry J. Reedy
New submission from Terry J. Reedy: The last week of last February, there was a discussion of this topic on python-ideas as part of "How the heck does async/await work in Python 3.5". I would like to re-start the discussion along with rescuing the two big chunks of code that were posted.