0

I have a list of links that I process with a function. But the problem is that it happens very slowly. How can I not wait for the function to complete? I apologize in advance, I'm new to this.

import requests

def check(link):
    response = requests.get(link)
    print(response.text)

list = []
for link in list:
    check(link)
  • 1
    Does this answer your question? [background function in Python](https://stackoverflow.com/questions/7168508/background-function-in-python) – istepaniuk Aug 12 '21 at 09:43
  • Open your function in a Thread and continue processing in your main thread. (if you have a lot of calls, better use a Thread Pool with a limited number of threads, so that you won't create thousands of threads working concurrently) – artur99 Aug 12 '21 at 09:48

0 Answers0