← Home About Archive Also on Micro.blog
  • objc_asyncio: An asyncio eventloop for PyObjC

    I’ve been working on an asyncio eventloop for PyObjC on and of over the last couple of months. This has finally resulted in an initial release (1.0b1) on PyPI: objc_asyncio.

    The code is complete, with proper test coverage, but I haven’t seriously used the library yet which is why I’ve started out with a beta release. For now the library requires Python 3.8 or 3.9, support for 3.7 is on my roadmap.

    To use asyncio in a Cocoa GUI:

    import sys
    import Cocoa
    
    import objc_asyncio
    
    with objc_asyncio.running_loop():
        Cocoa.NSApplicationMain(sys.argv)
    

    The, fairly minimal, documentation is found at read the docs, although the regular asyncio documentation and resources should be used to learn how to use asyncio.

    Installation:

    $ python3.8 -m pip install --pre objc_asyncio
    

    This has taken more time than I’d expected up front, it didn’t help that I basically didn’t know asyncio before I started.

    I’m not entirely happy with the amount of code in the library, I had to clone a lot of standard library code because the builtin loops assume that Python is in control of the eventloop itself and because I try to avoid depending on private APIs. Luckily it was possible to keep a clear separation between my own code and code cloned from asyncio.

    → 10:45 AM, Jun 22
  • Started work on an asyncio event loop for PyObjC

    I’ve started work on an asyncio event loop for PyObjC. This currently can basically just run the script below, but should improve soon enough…

    from objc_asyncio import _loop as loop
    
    el = loop.EventLoop()
    el.call_soon(lambda a: print(a), "hello world")
    el.call_later(1.0, lambda: print("timer 1"))
    el.call_later(2.0, lambda: print("timer 2"))
    el.call_later(2.5, lambda: el.stop())
    el.run_forever()
    
    → 9:29 PM, Mar 24
  • Progress…

    from objc_asyncio import _loop as loop
    
    el = loop.EventLoop()
    el.call_soon(lambda a: print(a), "hello world")
    el.call_later(1.0, lambda: print("timer 1"))
    el.call_later(2.0, lambda: print("timer 2"))
    el.call_later(2.5, lambda: el.stop())
    el.run_forever()
    
    → 9:25 PM, Mar 24
  • Working from home starts earlier than expected. New measures to stop spread of coronavirus in the Netherlands - News item - Government.nl

    → 8:13 PM, Mar 12
  • I’ve migrated the PyObjC repository to GitHub, its new home is github.com/ronaldous…

    → 10:09 PM, Mar 1
  • I’ve pushed a new release (0.21) of py2app to PyPI. This primarily updates the compiled stub executables by rebuilding those with an older compiler to fix an issue with Tkinter on macOS 10.15.

    → 11:07 AM, Feb 11
  • hello

       from sys import path
     
    → 8:55 PM, Jan 21
  • Welcome to your test blog! You can create new posts here to test theme and design changes.

    → 8:52 PM, Jan 21
  • RSS
  • JSON Feed
  • Micro.blog