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

TGINSIGHT SIMILAR POSTS

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

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

Отдельно разберём TaskGroup, который пришел на замену gather в Python 3.11. Ключевые отличия ▫️create_task() возвращает объект asyncio.Task, у которого есть соответствюущие методы управления. То есть у нас больше контроля ▫️это контекстный менеджер, который гарантирует что все таски будут остановлены по выходу из контекста ▫️ошибка автоматически отменяет незавершенные задачи, ▫️except* передает нам ExceptionGroup, в котором каждую ошибку можно обработать отдельно import asyncio import random async def do_it() -> str: if random.random() < 0.1: raise ValueError('Oops') delay = random.uniform(0.5, 1.5) await asyncio.sleep(delay) return delay async def main(): try: async with asyncio.TaskGroup() as tg: for _ in range(10): tasks.append(tg.create_task(do_it())) for t in tasks: print(t.result()) except *ValueError as e: for err in e.exceptions: print(err) asyncio.run(main()) Рекомендую изучить страницу Coroutines and Tasks из документации, где представлено больше интересных примеров и механизмов - таймауты - отмена задач - создание задач из другого потока #async

Hashtags

Резултати

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

Пребарај: #dictation

当前筛选 #dictation清除筛选

Дорогие друзья! 📚 Русский дом в Нью-Дели приглашает вас принять участие в международной исторической акции «Диктант Победы». 📆 Ждем Вас 24 апреля в 12:00. 🔗 Язык диктанта - русский и английский. 🏢 Место проведения: Русский дом в Нью-Дели. 📍Адрес: 24, Фироз Шах Роуд, г. Нью-Дели. ✅ Вход для посетителей мероприятия - свободный. 🔗При себе необходимо обязательно иметь ID-карту (на бумажном носителе). 💎 Не упустите возможность стать частью важного события! Ждем Вас! #РусскийДом#Диктант#Индия Dear friends! 📚 The Russian House in New Delhi invites you to participate in the international historical campaign "Victory Dictation." 📆 We look forward to seeing you on April 24 at 12:00 p.m. 🔗 The language of the dictation is Russian and English. 🏢 Venue: Russian House in New Delhi. 📍Address: 24, Firoz Shah Road, New Delhi. ✅ Entrance for visitors to the dictation is free. 💎 Don't miss the opportunity to become part of an important event! We are waiting for you! #RussianHouse#Dictation#India

Libreware

@libreware · Post #1477 · 07.08.2025 г., 03:49

WhisperTux Simple #voice#dictation application for #Linux. Uses whisper.cpp for offline speech-to-text transcription. No fancy GPUs are required although whisper.cpp is capable of using them if available. Once your speech is transcribed, it is sent to a ydotool daemon that will write the text into the focused application. Features Local speech-to-text processing via whisper.cpp (no cloud dependencies) No expensive hardware required (works well on a plain x86 laptop with AVX instructions) Global keyboard shortcuts for system-wide operation Automatic text injection into focused applications Configurable whisper models and shortcuts https://github.com/cjams/whispertux #assistant#speech#stt