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

Резултати

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

Пребарај: #nextgentech

当前筛选 #nextgentech清除筛选
ChatGPT AI Technology News

@chatgpt_officialnews · Post #67 · 24.03.2025 г., 15:59

🚀 Student Mode – Your AI Study Buddy! 📚🎓 Struggling with studies? AI is now your ultimate learning assistant! 🏆 ✨ What can it do? ✅ Homework Help – Get explanations & answers instantly! ✅ Summarize Texts & Notes – Save time while studying! ✅ Answer Any Subject Questions – Math, Science, History & more! 💡 How to activate? Simply type: 🔹 /mode – Select Student Mode for a smart study buddy! 🔹 Need help? @OpenAI_helpdesk 🔹 Join the discussion: https://t.me/chatgpt_officialchat 🔥 Ace your studies with AI-powered learning! ➖➖➖➖🔻 💎@Chatgpt_OfficialNews – Stay Updated! ⚡️ 🧠 BOT: @Chatgpt_OfficialBOT #️⃣#GPT4.5 #SmartAI#NextGenTech#AIUpgrade#GPTModel ➖➖➖➖🔺

ChatGPT AI Technology News

@chatgpt_officialnews · Post #62 · 22.03.2025 г., 17:52

Nearly 100% of cancer identified by new AI, easily outperforming doctors | In what's expected to soon be commonplace, AI is being harnessed to pick up signs of cancer more accurately than the trained human eye. 🔥 The ultimate all-in-one AI mode is here! Try it today! ➖➖➖➖🔻 💎@Chatgpt_OfficialNews – Stay Updated! ⚡️ 🧠 BOT: @Chatgpt_OfficialBOT #️⃣#GPT4.5 #SmartAI#NextGenTech#AIUpgrade#GPTModel ➖➖➖➖🔺

ChatGPT AI Technology News

@chatgpt_officialnews · Post #61 · 22.03.2025 г., 15:59

🚀 Standard Mode – The Perfect Balance! 🎯🤖 Need a reliable, well-rounded AI assistant? Standard Mode is here! 🏆 ✨ What can it do? ✅ Great for everyday tasks – Chatting, answering questions, and quick research. ✅ Balanced Performance – No overcomplications, just smart AI! ✅ Perfect for casual and professional use – Your all-in-one AI assistant. 💡 How to activate? Simply type: 🔹 /mode – Select Standard Mode for a smooth AI experience! 🔹 Need help? @OpenAI_helpdesk 🔹 Join the discussion: https://t.me/chatgpt_officialchat 🔥 The ultimate all-in-one AI mode is here! Try it today! ➖➖➖➖🔻 💎@Chatgpt_OfficialNews – Stay Updated! ⚡️ 🧠 BOT: @Chatgpt_OfficialBOT #️⃣#GPT4.5 #SmartAI#NextGenTech#AIUpgrade#GPTModel ➖➖➖➖🔺

ChatGPT AI Technology News

@chatgpt_officialnews · Post #56 · 21.03.2025 г., 15:59

🚀 The Next Leap – GPT-4.5 is Here! 🌍🔥 Welcome to the future of AI with GPT-4.5 – smarter, faster, and better than ever! 💡🤖 ✨ Why Choose GPT-4.5? ✅ Reduced Hallucinations – More accurate responses! ✅ Enhanced Memory – AI that understands better! ✅ Next-Level Performance – Optimized for complex tasks! 💡 How to activate? Simply type: 🔹 /model – Choose GPT-4.5 for peak performance! 🔹 Need help? @OpenAI_helpdesk 🔹 Join the discussion: https://t.me/chatgpt_officialchat 🔥 Unlock the power of GPT-4.5 today! ➖➖➖➖🔻 💎@Chatgpt_OfficialNews – Stay Updated! ⚡️ 🧠 BOT: @Chatgpt_OfficialBOT #️⃣#GPT4.5 #SmartAI#NextGenTech#AIUpgrade#GPTModel ➖➖➖➖🔺

ChatGPT AI Technology News

@chatgpt_officialnews · Post #69 · 25.03.2025 г., 15:59

🚀 Psychologist Mode – AI That Listens! 🧠💬 Need someone to talk to? Psychologist Mode is here for thoughtful, supportive conversations. 💖 ✨ What can it do? ✅ Offers Emotional Support – AI that listens & responds with care. ✅ Stress & Anxiety Advice – Get helpful guidance anytime. ✅ Confidential & Non-Judgmental – Your personal AI therapist. 💡 How to activate? Simply type: 🔹 /mode – Select Psychologist Mode for mindful AI conversations! 🔹 Need help? @OpenAI_helpdesk 🔹 Join the discussion: https://t.me/chatgpt_officialchat 🔥 Your AI support system is just one command away! ➖➖➖➖🔻 💎@Chatgpt_OfficialNews – Stay Updated! ⚡️ 🧠 BOT: @Chatgpt_OfficialBOT #️⃣#GPT4.5 #SmartAI#NextGenTech#Psychologue#GPTModel ➖➖➖➖🔺

ChatGPT AI Technology News

@chatgpt_officialnews · Post #65 · 23.03.2025 г., 15:59

🚀 Programmer Mode – Code Like a Pro! 💻🧠 Calling all developers & tech enthusiasts! 🖥 GPT is now optimized for coding & debugging! ✨ What can it do? ✅ Write & Debug Code – Get instant programming help! ✅ Supports Multiple Languages – Python, JavaScript, C++, and more! ✅ Explains Complex Concepts – AI-powered programming tutor! 💡 How to activate? Simply type: 🔹 /mode – Select Programmer Mode to unlock coding power! 🔹 Need help? @OpenAI_helpdesk 🔹 Join the discussion: https://t.me/chatgpt_officialchat 🔥 Boost your productivity with AI-powered coding assistance! ➖➖➖➖🔻 💎@Chatgpt_OfficialNews – Stay Updated! ⚡️ 🧠 BOT: @Chatgpt_OfficialBOT #️⃣#GPT4.5 #SmartAI#NextGenTech#AIUpgrade#GPTModel#AI#News ➖➖➖➖🔺