Re: [Tkinter-discuss] TKinter and Python asyncio

2018-01-05 Thread Alan Gauld via Tkinter-discuss
On 19/12/17 23:40, c.bu...@posteo.jp wrote: > I need to download between 100 or 200 xml-like files from different > locations. More specific: I use "feedparser" to get rss/atom feeds. > The issue is probably not how many files you need but how many sites you need. If it is 1 file per site I'd def

Re: [Tkinter-discuss] TKinter and Python asyncio

2017-12-20 Thread Bhaskar Chaudhary
Hi In a slight modification to your code, I created the asyncio event_loop in the main thread and passed it as an argument to the asyncio thread. Now Tkinter won't freeze while the urls are fetched. I have added the modified code as an answer to your stack overflow question here: https://stackove

Re: [Tkinter-discuss] TKinter and Python asyncio

2017-12-20 Thread c.buhtz
X-Post: Dear Bhaskar, thank you very much for your answer and the links. On 2017-12-20 13:06 Bhaskar Chaudhary wrote: > Here's a very simple example I borrowed from > http://blog.iharder.net/2017/02/03/python-asyncio-and

Re: [Tkinter-discuss] TKinter and Python asyncio

2017-12-19 Thread Bhaskar Chaudhary
Here's a very simple example I borrowed from http://blog.iharder.net/2017/02/03/python-asyncio-and-tkinter-together-with-tcp-and-udp/: Here is the raw code: https://pastebin.com/raw/ZGeDULR9 This listens for tcp messages on port and prints it to a Tkinter label as and when the message arriv

Re: [Tkinter-discuss] TKinter and Python asyncio

2017-12-19 Thread c.buhtz
On 2017-12-20 00:23 Michael Lange wrote: > to me like it might be much easier to just download the files from > within a separate thread. I don't know what exactly you want to > achieve of course, but from your first post my impression was that > using threads should not be overly difficult. I mig

Re: [Tkinter-discuss] TKinter and Python asyncio

2017-12-19 Thread Michael Lange
On Tue, 19 Dec 2017 23:21:16 +0100 wrote: > On 2017-12-19 04:18 Bhaskar Chaudhary wrote: > > Check out this code: > > https://github.com/fluentpython/asyncio-tkinter > > > > Download the entire code from above and run tkapp2.py > > The example doesn't run on Python3.6. It is quite old and mayb

Re: [Tkinter-discuss] TKinter and Python asyncio

2017-12-19 Thread c.buhtz
On 2017-12-19 04:18 Bhaskar Chaudhary wrote: > Check out this code: > https://github.com/fluentpython/asyncio-tkinter > > Download the entire code from above and run tkapp2.py The example doesn't run on Python3.6. It is quite old and maybe use some deprecated concepts? The code itself is quite

Re: [Tkinter-discuss] TKinter and Python asyncio

2017-12-18 Thread Bhaskar Chaudhary
Hi Check out this code: https://github.com/fluentpython/asyncio-tkinter Download the entire code from above and run tkapp2.py which uses asyncio with Tkinter - to count frequency of word in a large file - which freezes the GUI when run linearly but when run with asyncio handles it without blockin

Re: [Tkinter-discuss] TKinter and Python asyncio

2017-12-18 Thread c.buhtz
Dear Bhaskar, thank you for your answer. On 2017-12-18 20:37 Bhaskar Chaudhary wrote: > No its not at all a bad idea to combine tkinter with asyncio. Asyncio > is a good thing to use whenever you have an I/O bound task which is > likely to take too much time and interfere with the main loop. I

Re: [Tkinter-discuss] TKinter and Python asyncio

2017-12-18 Thread Bhaskar Chaudhary
No its not at all a bad idea to combine tkinter with asyncio. Asyncio is a good thing to use whenever you have an I/O bound task which is likely to take too much time and interfere with the main loop. asyncio uses a single-threaded approach and starts an event loop using a call to asyncio.get_eve

[Tkinter-discuss] TKinter and Python asyncio

2017-12-18 Thread c.buhtz
Hello, is it a bad idea to combine tkinter and asyncio package in Python3.5? Or is it even possible? I am also not sure if asynchronus programming is the solution of my problem: I try to create a Newsfeed-Reader (RSS & Atom). So I when the application refresh all feeds it will cause downloading e