Skip to content

Instantly share code, notes, and snippets.

import gevent.monkey
import requests
gevent.monkey.patch_all()
urls = ['https://www.google.com', 'https://www.yahoo.com', 'https://www.geektime.co.il']
def is_online(url):
response = requests.get(url=url)
if (response.ok):
print(f"Site is online: {url}")
@emil45
emil45 / python_requests_comprasion.py
Last active May 26, 2021 19:46
Python speed comparison between different approaches to make network requests
import threading
import multiprocessing
import asyncio
import time
import requests
import httpx
URL = "https://httpbin.org/delay/2"
NOR = 1000