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

TGINSIGHT SIMILAR POSTS

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

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

Наверняка вы замечали, что в Python есть удобная функция для получения переменной окружения os.getenv(NAME) И её "сестра" для создания или изменения переменных окружения os.putenv(NAME, VALUE) Но почему-то putenv() не работает как должно. Энвайромент не обновляется! os.putenv('MYVAR', '1') print(os.getenv('MYVAR')) ... и ничего 😴 Почему так? На самом деле энвайромент обновляется, но это значение не добавляется в словарь os.environ. Откройте исходник функции os.getenv(). Это просто шорткат для os.environ.get() В то время как putenv() это built-in С-функция. Словарь os.environ (или точней класс из MutableMapping) создаётся из энвайромента в момент инициализации. Функция putenv() самостоятельно его не изменяет. В тоже время, когда вы создаёте или изменяете ключ в os.environ, автоматически вызывается putenv() в методе __setitem__(). То есть, технически putenv() всё делает верно, но в os.environ это не отражается. Можно проверить так: >>> os.putenv('MYVAR', '123') >>> os.system('python -c "import os;print(os.getenv(\'MYVAR\'))"') 123 Я объявил переменную в текущем процессе и вызвал дочерний процесс, который её унаследовал и получил в составе os.environ. Аналогично при удалении переменной вызывается еще одна built-in функция unsetenv(), удаляющая переменную из системы. Итого ▫️ Удобней всего явно обновлять переменные через os.environ ▫️ Есть способ неявно создать/удалить переменную через putenv/unsetenv, что не повлияет на os.environ но изменит энвайромент и передаст изменения сабпроцессам. Но так лучше не делать! ▫️os.environ это просто обертка для built-in функций putenv() и unsetenv(). #basic

Hashtags

Резултати

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

Пребарај: #nextgenai

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

@chatgpt_officialnews · Post #55 · 21.03.2025 г., 04:57

1️⃣Unlock Seamless Conversations – Chat Like a Pro! 🤖 Say hello to your new best buddy,@Chatgpt_OfficialBOT! 🤖I’m here to chat with you about anything under the sun, 24/7. Want to know random facts or get quick answers? Just toss me a question! Try this: “Hey, what’s the capital of France?” I’ll zip back with: “Oh, easy peasy! The capital of France is Paris – ooh la la!” It’s like having a super-smart friend who never sleeps. Let’s chat and have some fun! ➖➖➖➖🔻 💎@Chatgpt_OfficialNews – Stay Updated! ⚡️ 🧠 BOT: @Chatgpt_OfficialBOT #️⃣#ChatGPT#AI#ChatBot#NextGenAI#OpenAI ➖➖➖➖🔺

ChatGPT AI Technology News

@chatgpt_officialnews · Post #96 · 07.05.2025 г., 16:16

🚨 MAJOR UPDATE + NEW NAME INCOMING! 🚨 Hey, digital explorers! Big news: your favorite Telegram AI buddy just got a mega upgrade—and it’s rocking a brand-new identity! Say hello to NeuralHubs AI 🧠⚡️ We’ve outgrown our old circuits, and this evolution is more than just a fresh coat of paint—it’s a full-on AI metamorphosis. 🦋🤖 ✨What’s new? 💡 Smarter than ever: Upgraded intelligence engine—wittier, wiser, and way more helpful. ⚡️ Blazing fast replies: Because patience is sooo pre-2024. 🌍 Multilingual mastery: Chat in your language—we now support way more of them! 🛠 Powerful new tools: From content gen to file help—we’ve got fresh tricks. 🔒 Improved privacy: Because your secrets are safe with NeuralHubs. 🤫 🎨 Sleek new interface & name: Welcome to NeuralHubs AI—your smart assistant HQ. 🧠 Why this matters: This isn’t just an update. It’s a new era. NeuralHubs AI is built to serve creators, students, thinkers, and memers alike—with intelligence that adapts to you. 📣 So next time you see the name NeuralHubs AI, just know—it’s your trusty AI pal, now upgraded and ready for greatness. ➖➖➖➖🔻 💎@Chatgpt_OfficialNews → Soon to be @NeuralHubsNews 🤖 BOT: @Chatgpt_OfficialBOT → Soon @NeuralHubsBot #️⃣#NeuralHubsAI#AIUpdate#TelegramBot#NextGenAI ➖➖➖➖🔺

ChatGPT AI Technology News

@chatgpt_officialnews · Post #52 · 21.03.2025 г., 04:36

🤖 OpenAI’s NextGenAI is Here to Supercharge Research & Education! Big news, folks! OpenAI just launched NextGenAI, a game-changing consortium with 15 top-notch institutions like Harvard, MIT, and Oxford! They’re tossing in $50 million (yes, MILLION!) plus API access to turbocharge AI research and education. 🧠 What’s the vibe? Scientists hunting cures, students mastering AI, and scholars digging up epic insights – all with OpenAI’s tech in their toolbox! 💡 Picture this: Harvard speeding up rare disease diagnoses, Oxford digitizing ancient texts, and more. It’s like giving the world’s brainiest minds an AI-powered jetpack! Stay tuned – this is just the start of something huge! ➖➖➖➖🔻 💎@Chatgpt_OfficialNews – Stay Updated! ⚡️ 🧠 BOT: @Chatgpt_OfficialBOT #️⃣#NextGenAI#AIResearch#EducationRevolution#OpenAI#FutureIsNow ➖➖➖➖🔺

ChatGPT AI Technology News

@chatgpt_officialnews · Post #51 · 20.03.2025 г., 15:59

🚀 Introducing GPT-4o – The Ultimate AI Experience! 🤯✨ Get ready for powerful, cutting-edge AI with GPT-4o! 🏆🔥 ✨ What makes GPT-4o special? ✅ Super Smart – Advanced reasoning & deep contextual understanding! ✅ Lightning Fast – Faster than ever before! ✅ Multi-Purpose – Writing, coding, learning, and more! 💡 How to activate? Simply type: 🔹 /model – Choose GPT-4o for the best AI experience! 🔹 Need help? @OpenAI_helpdesk 🔹 Join the discussion: https://t.me/chatgpt_officialchat 🔥 Experience AI like never before with GPT-4o! ➖➖➖➖🔻 💎@Chatgpt_OfficialNews – Stay Updated! ⚡️ 🧠 BOT: @Chatgpt_OfficialBOT #️⃣#GPT4o#NextGenAI#PowerfulAI#AIChat#SmartAI ➖➖➖➖🔺