Coder Social home page Coder Social logo

asyncio-tkinter's Introduction

Using asyncio with Tkinter

The tkapp.py and tkapp2.py examples in this folder demonstrate:

  • using an alternative asyncio.BaseEventLoop subclass on top of the Tkinter event loop;
  • leveraging futures and yield from to escape callback hell;
  • applying the asyncio abstractions to GUI programming instead of network programming.

History

The code is adapted from Dino Viehland's (@DinoV) talk Using futures for async GUI programming in Python 3.3 presented at PyCon US 2013. Dino's example used Tulip because the first release of asyncio was not available then; some APIs changed later and the tkapp.py was not working with Python 3.4 and asyncio from the standard library.

Luciano Ramalho (@ramalho) updated this code to run with Python 3.4 with help and encouragement from Guido van Rossum (@gvanrossum). See relevant thread in the python-tulip group.

Ramalho also wrote the tkapp2.py which makes it easier to run the three demonstrations from Viehland's talk: sequential processing, asynchronous with callbacks and asynchronous with coroutines.

Alan Cristhian (@AlanCristhian) fixed the hang-on-exit bug by turning the asyncio event loop thread into a daemon; see guievents.py, method GuiEventLoop._start_io_event_loop.

asyncio-tkinter's People

Contributors

alancristhian avatar ramalho avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.