1. Using asynchronous for loops in Python

    asyncio has brought support for asynchronous I/O with an event loop to Python 3. Since Python 3.5, we can use the async and await keywords:

    async def get(self):
        await self.wait_for_token()
        return self.client.get()
    

    But Python 3.5 also brought support for asynchronous context managers (async …

    read more

    There are comments.

  2. Indenting JSON in Python

    Main JSON railroad diagram - http://www.json.org/fatfree.html

    At work, I recently wanted to visualize how we annotated documents that we store as JSON in Elasticsearch. We annotate substrings with different codes, and I wanted to show those codes using colors in a terminal. This basically boils down to outputting JSON with ANSI escape codes. The easier part …

    read more

    There are comments.

  3. How do you limit memory usage with asyncio?

    One of the first hurdles that you can encounter when trying out asyncio is "asyncio eats all my memory!". Indeed, to keep your CPU busy, you're encouraged to launch a lot of coroutines simultaneously. Coroutines don't use a lot of memory by themselves, but what you're doing inside them can …

    read more

    There are comments.

  4. Diagnostiquer un problème de connexion Internet à La Réunion

    Je travaille à distance depuis La Réunion. La première condition pour du télétravail réussi, c'est d'avoir une bonne connexion Internet. C'est parfaitement possible à La Réunion, mais comment faire quand ça ne va pas ? Il faut savoir où est un problème pour pouvoir le corriger. En arrivant ici, j'aurais aimé …

    read more

    There are comments.

Page 1 / 3 »