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 слични објави

Пребарај: #pyside6

当前筛选 #pyside6清除筛选
GitHub Trends

@githubtrending · Post #15059 · 14.08.2025 г., 12:30

#python#pyside6#python#youtube_dl#youtube_downloader#yt_dlp#yt_dlp_gui YTSage is a user-friendly app that lets you download YouTube videos in any quality, extract audio, and get subtitles easily through a clean interface. You can download single videos or entire playlists, save thumbnails and descriptions, remove sponsor segments, and even trim videos. It supports login with cookies for private content and updates itself automatically. Installation is simple via pip or pre-built executables for Windows, Linux, and macOS. This tool helps you save and organize YouTube content efficiently with advanced options like speed limiting and custom commands, making video downloading fast and convenient. https://github.com/oop7/YTSage

GitHub Trends

@githubtrending · Post #14740 · 23.05.2025 г., 12:30

#python#async#asyncio#cross_platform#downloader#gui#multithreading#pyqt#pyside6#python#qt#software#streaming Ghost Downloader 3 is a fast, AI-powered download manager that works on Windows, Linux, and macOS. It speeds up downloads by splitting files into many parts and using multiple threads, dynamically adjusting to use your full bandwidth. It supports resuming downloads, proxy settings, SSL security, and clipboard monitoring for easy link capture. The interface is modern and user-friendly. This tool helps you download files more quickly and efficiently, with options to control speed and use proxies, making it ideal if you want faster, smarter, and more reliable downloads on your computer[1]. https://github.com/XiaoYouChR/Ghost-Downloader-3

GitHub Trends

@githubtrending · Post #14715 · 17.05.2025 г., 11:30

#python#ai#ai_art#art#asset_generator#chatbot#deep_learning#desktop_app#image_generation#mistral#multimodal#privacy#pygame#pyside6#python#self_hosted#speech_to_text#stable_diffusion#text_to_image#text_to_speech#text_to_speech_app AI Runner is a tool that lets you use AI on your own computer without needing the internet. It can do many things like **voice chatbots**, **text-to-image** generation, and **image editing**. You can also make AI personalities for more interesting conversations. It runs fast and securely, keeping your data private. To use AI Runner, you need a good computer with a strong GPU, like an NVIDIA RTX 3060 or better. This helps keep your data safe and makes AI tasks faster. https://github.com/Capsize-Games/airunner