Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@unsync()
async def download_some():
print("Downloading...")
url = 'https://talkpython.fm/episodes/show/174/coming-into-python-from-another-industry-part-2'
async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(ssl=False)) as session:
async with session.get(url) as resp:
resp.raise_for_status()
text = await resp.text()
print("Downloaded (more) {:,} characters.".format(len(text)))
@unsync(cpu_bound=True)
def compute_some():
print("Computing...")
for _ in range(1, 10_000_000):
math.sqrt(25 ** 25 + .01)
@unsync()
async def download_some():
print("Downloading...")
url = 'https://talkpython.fm/episodes/show/174/coming-into-python-from-another-industry-part-2'
async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(ssl=False)) as session:
async with session.get(url) as resp:
resp.raise_for_status()
text = await resp.text()
print("Downloaded (more) {:,} characters.".format(len(text)))
@unsync()
def download_some_more():
print("Downloading more ...")
url = 'https://pythonbytes.fm/episodes/show/92/will-your-python-be-compiled'
resp = requests.get(url)
resp.raise_for_status()
text = resp.text
print("Downloaded {:,} characters.".format(len(text)))
@unsync(cpu_bound=True)
def compute_some():
print("Computing...")
for _ in range(1, 10_000_000):
math.sqrt(25 ** 25 + .01)
@unsync()
def download_some_more():
print("Downloading more ...")
url = 'https://pythonbytes.fm/episodes/show/92/will-your-python-be-compiled'
resp = requests.get(url)
resp.raise_for_status()
text = resp.text
print("Downloaded {:,} characters.".format(len(text)))