Answer the question
In order to leave comments, you need to log in
How to wait for threads to finish in Python?
Immediately I ask the admins not to close the topic because "it's easy to google." I googled - didn't find it.
Let's move on to the topic.
There is the following code:
def run(self):
# Работа с прокси
self.proxyList = self.jobProxy.split('\n') # Список прокси
self.jobCount = len(self.proxyList) # Количество прокси
# Цикл по созданию потоков
threads = []
for i in range(self.jobCount):
# Создаем новый поток и передаем ему 1 прокси
t = threading.Thread(target = self.mainProccess, args = (self.proxyList.pop(0),))
threads.append(t)
t.start()
# Конец цикла по созданию потоков
print('Работа завершена!')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question