Форум сайта python.su
Добрый день. Имеется код
thr_lst = [] sem = threading.Semaphore(S_THREADS) with sem: for ind, mail_to in enumerate(mail_list): if (ind != 0) and (ind % int(S_COUNTER_OF_SENT_EMAILS)) == 0: send_for_my_email() thr = threading.Thread( target=run_smtp_send, args=(mail_to,), daemon=True ) thr_lst.append(thr) thr.start() [i_thr.join() for i_thr in thr_lst]
Офлайн