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

Пребарај: #trmlabs

当前筛选 #trmlabs清除筛选
Venture Village Wall 🦄

@venturevillagewall · Post #4282 · 02.03.2025 г., 01:00

Bitcoin: Panic Buying Amid Market Shakeup Panic reactions in the market are evident as Bitcoin fluctuates. Key developments in the TON ecosystem include: - TVM Ventures launching a $100M fund for TON growth 🔗 - Updates from TON Core for Dec 2024 - Jan 2025 🔗 - Steve Yun discusses DeFi’s future in Telegram on CNBC 🔗 - First mid-core web3 game launched on TON 🔗 - Support program for Mini Apps initiated 🔗 - Innovations from Notcoin team highlighted 🔗 - LayerZero’s new USDT bridge enhances TON’s cross-chain capabilities 🔗 - Key investments in DeFi and SocialFi detailed by TVM Ventures 🔗 - TON’s ecosystem expands beyond major project monopolies 🔗 - TRM Labs introduces a comprehensive blockchain analysis tool for TON 🔗 - The domain believers.ton is permanently lost 🔗 #Bitcoin#DeFi#TON#Crypto#Web3#Investment#LayerZero#Blockchain#MiniApps#PanicBuying#TVMVentures#Notcoin#TRMLabs

Crypto M - Crypto News

@CryptoM · Post #64673 · 09.04.2026 г., 13:26

🚀 Drift Faces $285 Million Exploit Due to Social Engineering Tactics Drift experienced a significant exploit amounting to $285 million, attributed to suspected North Korean operatives employing in-person social engineering against its contributors. According to NS3.AI, the group targeted contributors at several major industry conferences over a six-month period leading up to the exploit. TRM Labs identified this incident as the largest DeFi hack of 2026 to date and the second-largest exploit in Solana's history. The attacker reportedly utilized CarbonVote Token to secure collateral acceptance, increase withdrawal limits, and extract assets, including USDC. #Drift#exploit#socialengineering#NorthKorea#DeFi#Solana#CarbonVoteToken#TRMLabs#USDC#cybersecurity

Crypto M - Crypto News

@CryptoM · Post #65273 · 12.04.2026 г., 13:10

🚀 Iran Reopens Strait of Hormuz with Bitcoin Toll Amid Ceasefire Iran has reopened the Strait of Hormuz under a two-week ceasefire, requiring tankers to pay a $1-per-barrel toll in Bitcoin for passage. According to NS3.AI, Hamid Hosseini stated that the system now processes 10 to 15 vessels daily, a significant decrease from the 135 vessels before the conflict. TRM Labs reported that since mid-March, Iran's military has collected up to $2 million per ship in Bitcoin, Chinese yuan, and potentially USDT. #Iran#StraitOfHormuz#BitcoinToll#Ceasefire#Tankers#NS3AI#Hosseini#TRMLabs#Military#Crypto#USDT#ChineseYuan#Shipping#Blockchain#IranEconomy#BTC