English
Open in Telegram

Messageimport os

23 October 2019
П
import os import os.path import wget #from threading import Thread import threading from queues import Queue class Downloader(threading.Thread): def init(self, queue): threading.Thread.init(self) self.queue = queue def run(self): while True: url = self.queue.get() self.download_file(url) self.queue.task_done() def download_file(self, url): file_name = url.split('/')[-1] wget.download(url, os.getcwd()+'/wwwroot/img/'+file_name) def loadImgs(imgs): queue = Queue() for i in range(5): t = Downloader(queue) t.setDaemon(True) t.start() for url in imgs: queue.put(url) queue.join()

Nearby in the feed

ППавелможно пример я на c# пишу обычноППавелпробывал
this message
LLM 🐈‍⬛https://docs.python.org/3.8/library/multiprocessing.html#process-and-exceptionsППавелспасибо буду разбираться
ССообщество Python ПрограммистовСообщество Python Программистов@python_scripts · group · Tech
4 169members43writing in 30 days
Venue feed Open in Telegram

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · Index limits · Remove a page · Catalog · Search · How we count