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

Резултати

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

Пребарај: #seamless

当前筛选 #seamless清除筛选
TokenPocket

@tokenpocket_channel · Post #1112 · 13.01.2024 г., 08:35

【TokenPocket Retweeted】 Retweeted TransitFinance : Unlimit Crypto is live🚀! Transit Buy goes global, unlocking infinite crypto possibilities! 🚀#Transit#Buy is now integrated with Unlimit Crypto ​unlimit_crypto, providing crypto on-ramp support to hundreds of thousands of users globally. Transit Buy spans the global entry points for #fiat and #cryptocurrency, ensuring #seamless access for you! #Crypto#TransitBuy#UnlimitCrypto 【Details】https://twitter.com/TokenPocket_TP/status/1746088055679934633 【Powered By】Crypto Box

Venture Village Wall 🦄

@venturevillagewall · Post #3617 · 21.12.2024 г., 10:22

Skynet Raises $1.20M Skynet has successfully raised $1.20 million to enhance its platform, which aims to empower AI agents to connect seamlessly with global resources. For more information, visit Skynet. #Skynet#AI#Funding#Resources#Tech#Innovation#Investment#Global#Agents#Platform#Development#Seamless#Connect#Empower#Industry#Tools

GitHub Trends

@githubtrending · Post #15087 · 23.08.2025 г., 12:00

#shell#cassowary#docker#freerdp#gnome#hacktoberfest#integration#kde#libvirt#linux#linux_app#nautilus#nix_flake#podman#qemu#qemu_kvm#seamless#winapps#windows#wine#xfce You can run Windows applications like Microsoft Office and Adobe Creative Cloud directly on your Linux desktop (KDE, GNOME, or XFCE) as if they were native apps using WinApps. It works by running Windows inside a virtual machine (using Docker, Podman, or libvirt) and then showing Windows apps seamlessly on Linux with FreeRDP. Your Linux home folder is accessible in Windows, and you can right-click files in Linux to open them with Windows apps. This lets you use all Windows programs without leaving Linux, improving productivity and convenience without needing dual boot or separate hardware. https://github.com/winapps-org/winapps