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

Резултати

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

Пребарај: #ethiopiaelection

当前筛选 #ethiopiaelection清除筛选
Borkena

@borkena · Post #6174 · 17.04.2026 г., 15:57

በኢትዮጵያ ካለ የኑሮ ውድነት ጋር በተያያዘ የወጣው መረጃ ፤ኢህአፓ በአስር ከተሞች ያቀደው ህዝባዊ ሰልፍ እንደማይቀር ማስታቁ እና ሌሎች ዜናዎች፡፡ https://youtu.be/7egBmPJpLDg?si=eU6qjiJ82Ocmv7d_#Ethiopia#News#EthiopianNews#EthiopiaElection

“ይበጀኛል የምለውን ለመምረጥ ጓጉቻለሁ”፦ የ18 ዓመቷ ሰላም ደመቀ ************************** የባህር ዳር ከተማ የ7ኛው አጠቃላይ ምርጫ የመራጮች ምዝገባ እየተከናወነ ሲሆን ነዋሪዎች ወደ ምርጫ ጣቢያዎች በመሄድ በመመዝገብ ላይ ናቸው። ከእነዚህ መራጮች መካከል አንዷ የሆነችው እድሜዋ 18 የሞላት ሰላም ደመቀ ለመጀመሪያ ጊዜ በጠቅላላ ምርጫው ድምፅ ለመስጠት የምርጫ ካርድ ወስዳለች፡፡ ለሰላም ደመቀ ይህ ምርጫ ለመጀመሪያ ጊዜ በሀገር ጉዳይ ላይ ድምፅ የምትሰጥበት የታሪኳ ምዕራፍ በመሆኑ ልዩ ትርጉም የሰጠችው ነው። ዕድሜዋ ለመራጭነት በመድረሱና ለመጀመሪያ ጊዜ የመምረጥ መብቷን የሚያረጋግጥላትን ካርድ በመያዟ ያላትን ደስታ ለኢቲቪ ገልጻለች። ሰላም የያዘችው የምርጫ ካርድ ለእሷ የመምረጥ መብት ብቻ ሳይሆን፣ የነገዋን ኢትዮጵያ በመቅረፅ ሂደት ውስጥ ተሳታፊ የሆነችበት የሉዓላዊነት ጉዞ መጀመሪያ ነው። ዕድሜያቸው ለመምረጥ የደረሱ ዜጎች ሁሉ ካርዳቸውን በወቅቱ በማውጣት ለሀገራቸው የዴሞክራሲ ልምምድ የድርሻቸውን እንዲወጡ ጥሪዋን አስተላልፋለች። በሳሙኤል ወርቅአየሁ Ethiopian Broadcasting Corporation #EBC#BahirDar#EthiopiaElection

Addis Standard

@addisstandardeng · Post #21944 · 04.04.2026 г., 14:07

🎬 3 Days. 3 Regions. One Election. As Ethiopia prepares for its 7th General Election in June 2026, Addis Standard brings you three back-to-back electoral profiles examining the regions where the stakes are highest. 📍 Monday - Oromia 📍 Tuesday - Amhara 📍 Wednesday - Tigray From political uncertainty and ongoing conflicts…to unresolved constitutional questions and shifting power dynamics… These regions could shape the direction of Ethiopia’s next political chapter. 📅 Monday. Tuesday. Wednesday, April 6, 7, and 8 2026. Don’t miss Addis Standard’s Special Election Dispatch in English, Amharic and Afaan Oromoo. #Ethiopia#EthiopiaElection#AddisStandard#Oromia#Amhara#Tigray#Election2026

Addis Standard

@addisstandardeng · Post #21936 · 03.04.2026 г., 16:30

#Premiering_now: The Standard Signal | Ep.15: Ethiopia Under Pressure: Fuel Crisis, Global & Regional Instability, a Fragile Election | Jawar Mohammed Click here to watch: https://www.youtube.com/watch?v=HexAbPk8Dkw Ethiopia is facing mounting pressures. In Episode 15 of The Standard Signal, host Tsedale Lamma brings Jawar Mohammed to discuss the deepening fuel shortage and corruption concerns in Ethiopia, the looming fertilizer crisis and its implications for food security, and the impact of Middle East war on Ethiopia’s economy and stability. #AddisStandard#TheStandardSignal#Ethiopia#JawarMohammed#EthiopiaPolitics#Corruption#FuelCrisis#HornOfAfrica#Tigray#Amhara#Oromia#EthiopiaElection#AfricaPolitics#EthiopiaNews#AfricanPolitics#Geopolitics

Addis Standard

@addisstandardeng · Post #21935 · 03.04.2026 г., 14:30

#Coming_UP: The Standard Signal | Ep.15: Ethiopia Under Pressure: Fuel Crisis, Global & Regional Instability, a Fragile Election | Jawar Mohammed #TsedaleLemma speaks with #JawarMohammed about the growing challenges facing Ethiopia, from global and regional tensions to domestic instability, corruption and Ethiopia’s fragile election. Premiers at: 7:30 PM EAT tonight. Subscribe to watch: https://www.youtube.com/@AddisStandard #AddisStandard#TheStandardSignal#Ethiopia#JawarMohammed#EthiopiaPolitics#Corruption#FuelCrisis#HornOfAfrica#Tigray#Amhara#Oromia#EthiopiaElection#AfricaPolitics#EthiopiaNews#AfricanPolitics#Geopolitics