This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import time | |
async def say_after(delay, what): | |
await asyncio.sleep(delay) | |
print(what) | |
async def use_await(): | |
await say_after(3, 'world') | |
await say_after(2, 'hello') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import asyncio | |
import aiohttp | |
import aiofiles | |
get_img_url = lambda i: 'https://cdn.discordapp.com/embed/avatars/' + str(i) + '.png' | |
def download_all_sync(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage: (python3 a.py < a.in) > a.out | |
import time, sys, inspect, platform | |
print = lambda *a, **k: __builtins__.print(str(inspect.currentframe().f_back.f_lineno)+':', | |
*a, file=sys.stderr, **k) if platform.node() in ['surfux', 'ssd'] else ... | |
#--------------------------------------------- | |
''' | |
i know this is 'sort-by-goodness' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage: (python3 a.py < a.in) > a.out | |
import time, sys, inspect, platform | |
print = lambda *a, **k: __builtins__.print(str(inspect.currentframe().f_back.f_lineno)+':', | |
*a, file=sys.stderr, **k) if platform.node() in ['surfux', 'ssd'] else ... | |
class EndTestCase(Exception): pass | |
#--------------------------------------------- |
OlderNewer