26 lines
547 B
Python
26 lines
547 B
Python
"""
|
|
async for
|
|
async with
|
|
"""
|
|
|
|
import asyncio, aiohttp
|
|
|
|
async def check(url):
|
|
async with aiohttp.ClientSession() as session:
|
|
async with session.get(url) as response:
|
|
print(f"{url} : status => {response.status}")
|
|
|
|
async def puissance2(stop= 10):
|
|
exponent = 0
|
|
while exponent < stop:
|
|
yield 2 ** exponent
|
|
exponent += 1
|
|
await asyncio.sleep(0.2)
|
|
|
|
async def main():
|
|
liste = []
|
|
async for i in puissance2():
|
|
liste.append(i)
|
|
print(liste)
|
|
|
|
liste = [j async for j in puissance2()] |