Skip to content

Instantly share code, notes, and snippets.

@qenops
qenops / gist:48e8882a7d7ecfa73e6a91e88cf3f150
Last active March 7, 2021 17:12
Python asyncio tasks in two sets
import asyncio
from random import randrange
import time
async def mustDoTask(name):
count = 0
start = time.time()
while count < 10:
print(f'longtask {name} loop {count}')
await asyncio.sleep(randrange(3,6)/10)
@qenops
qenops / rasperry-pi-stretch-setup
Last active July 12, 2018 17:07
Setup code for new raspberry pi including python, opencv
sudo raspi-config
# interfacing options -> camera -> enable
# advanced options -> expand filesystem
# reboot
# install vim
sudo apt-get install vim
# clean up bloatware
sudo apt-get purge wolfram-engine