@bestwallpapes · Post #3598 · 11.08.2025 г., 19:09
@Bestwallpapes #Shape#Background#Hexagon
Hashtags
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
Пребарај: #hexagon
@bestwallpapes · Post #3598 · 11.08.2025 г., 19:09
@Bestwallpapes #Shape#Background#Hexagon
Hashtags
@cosmomyst · Post #18 · 29.07.2025 г., 21:51
🪐 High above the north pole of Saturn, the storm known as the "Hexagon" forms a perfect six-sided jet stream wider than two Earths across. Unlike any weather pattern on Earth, this mysterious geometric cloud system has maintained its shape for decades, swirling in icy isolation since first observed by Voyager and later by the Cassini spacecraft. ✨ #Saturn⚡#Hexagon⚡#atmosphere 👉subscribe Universe Mysteries
Hashtags
@addisstandardeng · Post #21524 · 25.02.2026 г., 14:17
Will #Ethiopia be part of #Israel’s ‘hexagon’ alliance rivalling its enemies? Days after Israeli Prime Minister Benjamin #Netanyahu proposed forging a network of allied nations, including in the #Middle_East and #Africa, to stand against what he called “radical” adversaries, the country’s president is on an official visit to key ally, Ethiopia. It is not yet known which Arab and African countries will form part of Netanyahu’s hypothetical “#hexagon of alliances”, which he said on Sunday will include Israel, #India, #Greece, #Cyprus and others to stand against their enemies in the Middle East. Chief among those enemies is presumably #Iran and its network of resistance groups from #Hezbollah in #Lebanon to the #Houthis of #Yemen. Analysts doubt Israel could secure enough influence over nation-states to form a formal security pact. However, the country is deepening its ongoing charm.... https://web.facebook.com/AddisstandardEng/posts/pfbid02k6zhD7KwutXLnqV8A3PNCvX8aTQCduGEjMQcKEZKazJ7iuCCDwJdgwAZFULz2cMwl