if __name__ == '__main__': domain = [] with open('test5.txt','r') as f: for i in f.readlines(): domain.append(i.strip()) f.close() print(domain) start_time = time.time() pool = threadpool.ThreadPool(100) requests_1 = threadpool.makeRequests(getTitle, domain) [pool.putRequest(req) for req in requests_1] pool.wait() with open('test6.txt','w+',encoding='UTF-8') as f: for i in code_200: f.write(str(i) + '\n') for i in code_not200: f.write(str(i) + '\n') print('%d second' % (time.time() - start_time))