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

Резултати

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

Пребарај: #ocro

当前筛选 #ocro清除筛选

🚀 OCRO IEO: Built to Rise, Designed to Reward IEOs are changing the game—and Octario Exchange is leading the way with OCRO. Unlike traditional ICOs, the OCRO IEO is hosted directly on the exchange, offering trust, transparency, and real structure. Powered by the Rising Edge Mechanism, OCRO’s price increases across 3 phases: from $0.30 to $0.80, before launching at $1.00. 📈 Each phase = limited supply + higher price 🎯 Early buyers = best value + built-in scarcity OCRO holders also get real utility: low gas fees, access to blockchain games, and real-world asset exposure. Don’t miss this rare chance to join a token economy engineered to grow. 👉 Participate now at 📢 Let’s talk about the Rising Edge Mechanism that makes OCRO unique: 📈 Upward-Only Pricing You can’t sell OCRO for less than your purchase price. Every sale must occur higher than the last. 🔓 Demand-Driven Supply Every buy unlocks more tokens from escrow, fueling circulation only when there is real demand. ⚡️ Momentum Over Volatility Instead of price drops, market activity creates upward pressure. The more people participate, the stronger OCRO becomes. 💠 This makes OCRO the first token designed to rise by design. 👉octario.exchange #OCRO#IEO#CryptoLaunch#OctarioExchange#BuiltToRise

INK GAME — OFFICIAL TEASER JUST DROPPED! Inspired by Squid Game. Dark. Intense. Only for the brave. 🎮🔥 The countdown has begun… 13 January 2026 — the arena opens. Only 456 players will step inside. Only the worthy will compete. 🔻 QUALIFICATION TO ENTER THE 456 🟥 20,000 USDT Direct Sales OR 🟥 10,000 USDT Self-Purchase (OCRO Phase 2) This isn’t just a launch event — it’s a selection. ⚡ Massive rewards. ⚡ One arena. ⚡ Choose your faction… and survive. #INKGame#Octario#OCRO#SquidGameStyle#456PlayersOnly

🚀 Top news! 🚀 We are launching the OCRO token with guaranteed growth - the price will rise from $0.02 to $0.10 in just 90 days from June 6th! 💥 And the best part: register with our exclusive link NOW and get a $50 gift as a thank you! 🎁 🔗 *https://octario.exchange/login/register?InvitationCode=833700* Join the future of crypto with guaranteed growth and cool bonuses! Don't miss your chance - join today! 🚀✨ #Crypto#TokenLaunch#OCRO#GuaranteedGrowth#Investments#CryptoCommunity#IEO