A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
import threading | |
import asyncio | |
async def run_coro_threadsafe(self, coro, other_loop, our_loop = None): | |
"""Schedules coro in other_loop, awaits until coro has run and returns | |
its result. | |
""" | |
loop = our_loop or asyncio.get_event_loop() | |
# schedule coro safely in other_loop, get a concurrent.future back |
import asyncio | |
import threading | |
import random | |
def thr(i): | |
# we need to create a new loop for the thread, and set it as the 'default' | |
# loop that will be returned by calls to asyncio.get_event_loop() from this | |
# thread. | |
loop = asyncio.new_event_loop() |