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

Резултати

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

Пребарај: #tectonics

当前筛选 #tectonics清除筛选
Amazing Geography 🌍

@amazingeo · Post #613 · 04.02.2026 г., 20:31

🌍 Some earthquake "swarms" can hit the same spot repeatedly over weeks or months, releasing energy in small bursts instead of one big quake—often in volcanic or tectonic hot zones. ✨ #earthquakes⚡#tectonics⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #575 · 14.01.2026 г., 12:31

🌍 The planet’s largest earthquake ever measured—a magnitude 9.5—struck Chile in 1960. This event released so much energy it caused land to drop by up to two meters along the coast. ✨ #tectonics⚡#earthquakes⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #534 · 24.12.2025 г., 20:31

🌍 One of the fastest-moving tectonic faults is in Turkey, with plates shifting up to 23 millimeters per year. This constant motion makes the region prone to frequent, sometimes devastating earthquakes. ✨ #tectonics⚡#earthquakes⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #502 · 08.12.2025 г., 20:31

🌍 Some tectonic plate boundaries move so slowly they create “silent earthquakes”—huge shifts that happen over days or weeks, releasing energy without sudden shaking. ✨ #tectonics⚡#earthquakes⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #234 · 14.09.2025 г., 09:12

🌍 Some large earthquakes can trigger aftershocks that last for months or even years. These smaller quakes are part of the Earth’s ongoing adjustment after a major tectonic shift. ✨ #tectonics⚡#earthquakes⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #160 · 02.09.2025 г., 03:12

🌍 The strongest earthquakes ever recorded can move entire cities by several meters in seconds. In 2011, Japan’s coastline shifted east by up to 5 meters due to a massive plate boundary quake. ✨ #earthquakes⚡#tectonics⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #122 · 26.08.2025 г., 20:12

🌍 The San Andreas Fault in California allows two massive tectonic plates to slip past each other. This boundary creeps a few centimeters each year but can unleash powerful earthquakes in sudden jolts. ✨ #tectonics⚡#earthquakes⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #466 · 20.11.2025 г., 20:31

🌍 The ring-shaped chain of volcanoes called the "Ring of Fire" circles the Pacific Ocean, hosting about 75% of all active volcanoes on Earth and causing frequent earthquakes and eruptions. ✨ #volcanoes⚡#mountains⚡#tectonics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #692 · 16.04.2026 г., 20:31

🌍 The Atlantic Ocean is growing wider each year as the Americas slowly drift apart from Europe and Africa, adding about 2.5 centimeters annually—roughly the speed fingernails grow. ✨ #continents⚡#oceans⚡#tectonics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #348 · 08.10.2025 г., 18:31

🌍 The Eurasian and North American continents are moving apart by about 2.5 centimeters every year along the Mid-Atlantic Ridge, slowly widening the Atlantic Ocean over millions of years. ✨ #continents⚡#oceans⚡#tectonics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #18 · 10.08.2025 г., 10:27

🌍 The lithosphere’s tectonic plates move slowly, but sometimes collide to form tall mountain ranges like the Himalayas, linking Earth's rocky shell to the atmosphere and biosphere. ✨ #lithosphere⚡#tectonics⚡#mountains⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍

Amazing Geography 🌍

@amazingeo · Post #194 · 07.09.2025 г., 16:12

🌍 The Himalayas are rising by about 5 millimeters each year as the Indian and Eurasian plates continue to collide. This ongoing uplift makes these mountains among the youngest and fastest-growing on Earth. ✨ #mountains⚡#Himalayas⚡#tectonics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

12
ПретходнаСтраница 1 од 2Следна