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

Резултати

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

Пребарај: #seychelles

当前筛选 #seychelles清除筛选
Voyage.Travel.Tourism

@VOYAGE · Post #1008 · 30.06.2024 г., 12:14

🗺Seychelles🇸🇨 Anse Georgette is a remote beach on the northwest coast of Praslin Island. The shore features pristine white sand and round granite boulders. The beach is long, wide, and secluded, with almost no modern amenities. #Seychelles @voyage

Hashtags

RT en français

@RTenfrancais · Post #79820 · 22.04.2026 г., 14:15

🇷🇺🇸🇨#Russie–#Seychelles : accord culturel La Russie et les Seychelles ont signé un mémorandum de coopération culturelle entre leurs ministères respectifs, afin de structurer et d'élargir leurs échanges. L’accord prévoit le développement de projets communs dans les domaines du patrimoine, des musées et des événements internationaux, dans un contexte où les échanges artistiques sont déjà actifs entre les deux pays. La partie seychelloise s’est dite intéressée par l’expérience russe en matière de promotion culturelle et de préservation du patrimoine. Crédit photo : Service de presse du ministère russe de la Culture RT en français • Osez questionner !

RT en français

@RTenfrancais · Post #79897 · 23.04.2026 г., 12:48

⏺Patrick #Herminie, président de la république des #Seychelles, évoque la coopération de son pays avec les agences de voyage russes afin d’attirer les touristes aux Seychelles. RT en français • Osez questionner !

AI match predictions

@ai_match_prediction · Post #11211 · 29.03.2026 г., 05:05

Africa Cup of Nations - Qualification🌍 2026-03-29 13:00 UTC South Sudan vs. Djibouti Predicted outcome: South Sudan❌ Predicted score: 4:0 Actual: Djibouti 0:1 #SouthSudan#Djibouti 2026-03-29 15:00 UTC Lesotho vs. Seychelles Predicted outcome: Draw❌ Predicted score: 0:0 Actual: Lesotho 2:1 #Lesotho#Seychelles #Football#AfricaCupofNations

AI match predictions

@ai_match_prediction · Post #11186 · 26.03.2026 г., 09:05

Africa Cup of Nations - Qualification🌍 2026-03-26 13:00 UTC Djibouti vs. South Sudan Predicted outcome: South Sudan✅ Predicted score: 1:3 Actual: South Sudan 0:4 #Djibouti#SouthSudan 2026-03-26 14:00 UTC Seychelles vs. Lesotho Predicted outcome: Lesotho❌ Predicted score: 0:2 Actual: Draw 0:0 #Seychelles#Lesotho #Football#AfricaCupofNations