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 слични објави

Пребарај: #c4ca

当前筛选 #c4ca清除筛选
EU in Kazakhstan 🇪🇺🇰🇿

@euinkazakhstan · Post #1766 · 26.03.2026 г., 06:26

Operations Steering Committee of the EU Global Gateway’s Connectivity for Central Asia #C4CA project brought together consortium partners from Lithuania (CPVA), Latvia (CFCA), Estonia (EGA), Finland (HAUS), and France (Expertise France) in Bishkek, alongside the EU Delegations of Kazakhstan and Kyrgyzstan. As part of the Soft Pillar of the Team Europe Initiative on Digital Connectivity, the meeting reviewed first-year results and outlined priorities for the next phase, focusing on digital connectivity, digital economy development, and reducing connectivity gaps in Central Asia. The project delivered key outputs, including country assessments, digital ecosystem mapping, regional events during ICT Week in Uzbekistan and Digital Bridge, and study visits to Europe, Lithuania, and Finland on cybersecurity and the aerospace sector, in coordination with Central Asian stakeholders.

Hashtags

EU in Kazakhstan 🇪🇺🇰🇿

@euinkazakhstan · Post #1632 · 21.11.2025 г., 08:55

SpaceLab at Space Tech Forum, Germany 🚀 From 18–20 November 2025, SpaceLab represented Central Asia at the Space Tech Forum in Bremen, Germany, with support from the EU’s Global Gateway Connectivity for Central Asia – Soft Pillar program. At one of Europe’s largest space tech and aerospace events, SpaceLab established new contacts in the European space market, raised awareness of Central Asian innovative services among European industry players, and helped spark interest in the region on the international stage. The participation also contributed to strengthening cooperation between the #EuropeanUnion and #CentralAsia in the space sector and helped position SpaceLab and the broader Central Asian space community as a credible emerging player in the 🌍global space ecosystem. #SpaceTechForum#GlobalGateway#C4CA#EU4CA