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

TGINSIGHT SIMILAR POSTS

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

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

Три способа выполнить множество задач с asyncio Функция для примера: async def do_it(n): await asyncio.sleep(random.uniform(0.5, 1)) return n 1. Последовательный вызов async def main(): for i in range(100): result = await do_it(i) Такой вызов имеет смысл только тогда, когда результат одной задачи требуется для вызова следующей. Если они независимы, то это антипаттерн, так как аналогичен простому синхронному вызову по очереди. 2. Упорядоченный результат async def main(): tasks = [do_it(i) for i in range(100)] results = await asyncio.gather(*tasks) Выполняет корутины конкурентно и возвращает результат в виде списка. Полезен когда требуется получить результаты в том же порядке в котором задачи отправлены. 3. Результат по мере готовности tasks = [asyncio.create_task(do_it(i)) for i in range(100)] for cor in asyncio.as_completed(tasks): result = await cor Так же выполняет корутины конкурентно, но не гарантирует порядок. Результат возвращается по мере готовности, каждый отдельно. Полезен когда нужно обработать любой ответ как можно скорее. #async

Hashtags

Резултати

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

Пребарај: #dunes

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

@amazingeo · Post #656 · 09.03.2026 г., 20:31

🌍 Libya’s Libyan Desert holds sand seas with dunes reaching up to 180 meters tall. These giant dunes constantly shift with the wind, creating landscapes that can look completely different in just a few years. ✨ #desert⚡#dunes⚡#arid⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #274 · 20.09.2025 г., 19:31

🌍 In the Taklamakan Desert of China, some sand dunes reach up to 300 meters tall. Shifting winds keep these giant dunes moving, constantly reshaping the landscape year after year. ✨ #deserts⚡#dunes⚡#arid⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #354 · 10.10.2025 г., 12:31

🌍 In Australia’s Simpson Desert, certain red sand dunes can “move” up to a meter each year as winds slowly push millions of grains, gradually shifting entire hills across the arid landscape. ✨ #deserts⚡#dunes⚡#Australia⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #505 · 10.12.2025 г., 12:31

🌍 The world's highest coastal dune towers 352 meters above sea level at Pilat Dune in France. This massive sand formation shifts yearly as Atlantic winds pile new layers along the shore. ✨ #seacoast⚡#dunes⚡#landscape⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #391 · 19.10.2025 г., 15:31

🌍 The Namib Sand Sea is the only coastal desert made entirely of shifting sand dunes recognized as a UNESCO World Heritage site, with winds constantly sculpting waves of sand along the Atlantic coast. ✨ #desert⚡#dunes⚡#Namibia⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​