TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #401 · 15 дек.

Функция asyncio.wait() это еще один способ вызвать множество асинхронных задач. Она работает в нескольких режимах. 1. Самый простой - ждем завершения всех задач async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(10)] done, pending = await asyncio.wait( tasks, return_when=asyncio.ALL_COMPLETED ) for task in done: try: print(task.result()) except Exception as e: print(e) Очень похоже на gather, но работает не так. ▫️возвращает не результаты, а два сета с объектами Task у которых можно забрать результат через task.result() если они в списке done ▫️не гарантирует порядок результатов так как оба объекта это set ▫️не выбрасывает исключение когда оно появляется, а сохраняет его в Task. Исключение появится когда попробуете забрать резултьтат. 2. Ждем завершения первой задачи, даже если там ошибка. async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(3)] done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_COMPLETED ) # в done может быть несколько задач! for task in done: try: print(task.result()) except Exception as e: print(f"Fail: {e}") # Оставшиеся задачи в pending, как правило, нужно отменить, иначе они будут продолжать работать for task in pending: task.cancel() В сете done будут таски которые успели завершится, причем как успешно так и нет. 3. До первой ошибки. Тоже самое, но с аргументом FIRST_EXCEPTION done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_EXCEPTION ) Функция завершается как только первая задача упадет с ошибкой. Учтите, что в любом случае done вы можете обранужить несколько задач, как с ошибками так и успешные. ↗️ Полный листинг примеров здесь #async

Hashtags

Резултати

Пронајдени 2 слични објави

Пребарај: #opendialogue

当前筛选 #opendialogue清除筛选
Green University CA | Official

@centralasian_greenuniversity · Post #797 · 27.02.2026 г., 12:15

📸Highlights from the “Youth Day” at Green University #YouthDay#OpenDialogue ______________________ 📸Green University “Yoshlar kuni”dan lavhalar #YoshlarKuni#OchiqMuloqot ✉️[email protected] ☎️ +998 55 512 00 77 📍Location 🌐Website | 📱Telegram | 📱Instagram | 📱LinkedIn | 🟥YouTube

Green University CA | Official

@centralasian_greenuniversity · Post #790 · 27.02.2026 г., 05:51

Green University hosted an official meeting between the Rector and students on the occasion of “Youth Day.” 🗣During the event, the Rector of Green University, Dr. Bakhtiyor Pulatov, spoke about the conditions created for students, ongoing efforts to further enhance the quality of education, and future plans aimed at supporting young people. Students’ proposals and initiatives were also heard, and practical measures for their implementation were discussed. 💬The meeting was attended by a representative of the Youth Affairs Agency of the Republic of Uzbekistan, Elyor Norpulatov, who provided detailed information on the priority directions of the state youth policy and the opportunities being created for young people. The participants also discussed the content of the meeting between President Shavkat Mirziyoyev and youth, as well as the key priorities outlined during that dialogue, exchanging views on their effective implementation within the activities of higher education institutions. 👉ReadMore #YouthDay#OpenDialogue _____________________ Green University’da “Yoshlar kuni” munosabati bilan rektor va talabalar ishtirokida rasmiy uchrashuv bo‘lib o‘tdi. 🗣Tadbir davomida Green University rektori Professor Baxtiyor Pulatov talabalarga yaratilgan shart-sharoitlar, ta’lim sifatini yanada oshirish, yoshlarni qo‘llab-quvvatlashga qaratilgan istiqboldagi rejalar haqida so‘z yuritdi. Shuningdek, talabalar tomonidan bildirilgan taklif va tashabbuslar tinglanib, ularni amaliy qo‘llab-quvvatlash masalalari muhokama qilindi. 💬Uchrashuvda O‘zbekiston Respublikasi Yoshlar ishlari agentligi vakili Elyor Norpulatov ham ishtirok etib, yoshlarga oid davlat siyosatining ustuvor yo‘nalishlari hamda yaratilayotgan imkoniyatlar haqida ma’lumot berdi. Shuningdek, tadbir davomida President Shavkat Mirziyoyevning yoshlar bilan o‘tkazgan uchrashuvi mazmuni va unda belgilab berilgan ustuvor vazifalar muhokama qilinib, ularning ta’lim muassasalari faoliyatida samarali amalga oshirilishi yuzasidan fikr almashildi. 👉Batafsil #YoshlarKuni#OchiqMuloqot ✉️[email protected] ☎️ +998 55 512 00 77 📍Location 🌐Website | 📱Telegram | 📱Instagram | 📱LinkedIn | 🟥YouTube