I made a program that starts 4 threads using concurrent.futures and sends a request to each website in a list.
Problem: It just doesn't start
import requests
import threading
import concurrent.futures
list=['amazon.com', 'google.com', 'youtube.com', 'microsoft.com']
def start(url):
requests.get('https://'+url)
print(line+' finished')
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
for url in list:
executor.submit(start, url)
This on the other hand works:
import concurrent.futures
def start():
print('lol')
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
for i in range(10):
executor.submit(start)