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

Резултати

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

Пребарај: #safepal

当前筛选 #safepal清除筛选

Tangem Core. Reliability. ❤️ ✅ Three similar devices offer a second and third chance to recover your assets in case of accidents or loss. ✅ The #Tangem chip is a product of a collaboration with Samsung Semiconductors, Inc. Its incredible performance and reliability. ✅ The chip is fortified against electromagnetic pulses (EMP), electrostatic discharge (ESD), and X-rays, adhering to the stringent ISO 7816-1 standard for security. ✅ The entire wallet is IP69K certified, offering full dust and water resistance. It functions optimally in temperatures between –25°C and +50°C. ✅Tangem devices have an impressive 25-year replacement warranty, reflecting our confidence in their longevity and durability. ✅ As a monolithic device, no components have a shorter lifespan or are vulnerable to damage or hacking. 🛡When it comes to safeguarding your assets, nothing is more crucial than unwavering reliability.🤜 🛍🛍Easy buy a cold wallet Tangem with a 10% discount promo code: FG7L9X at tangem.com #Safepal#Ledger#Trezor#TON

Tangem Core: Security❤️ What's inside? ✅Certified equipment: The highest level of safety among consumer devices — EAL 6+. ✅Firmware tested twice: First in 2018 by the Swiss company Kudelski Security and again in 2023 by the international laboratory Riscure. Both audits confirmed the absence of vulnerabilities and backdoors in the firmware, which cannot be updated. ✅Open Source Software: Fully transparent and available for review on GitHub. ✅Anti-counterfeit protection: When you activate your wallet, the app verifies the secure element, confirming its authenticity with #Tangem. ✅Private Key Security: Private keys are generated inside the chip when the wallet is activated using a hardware random number generator. No one, including Tangem, has access to these keys. ✅Smart Backup: Three hardware devices instead of one, each providing the same high level of security. No unsafe copies required. ✅Absolute privacy: Your private keys cannot be disclosed under any circumstances. ✅User-controlled access: The wallet is protected by your access code and biometric authentication. 🛡This is what absolute safety means! 🛍🛍Easy buy a cold wallet Tangem with a 10% discount promo code: FG7L9X attangem.com #Safepal#Ledger#Trezor#TON

OKX DEX — DEX aggregator and cross-chain bridge — now available on Tangem!⚪️ With a new provider — new opportunities: - Over 1,000,000 new exchange pair options. - Over 1,500 new tokens available for swap. - No KYC. The team is improving the versatility and usability of the Tangem app by integrating more and more providers. Update your app and start exchanging crypto right now!🔄 🛍 Buy a cold wallet #Tangem with a 10% discountfrom our channel using the promo code:FG7L9X #safepal#ledger#trezor#ton#okx

OKX DEX — DEX aggregator and cross-chain bridge — now available on Tangem Express!⚪️ With the new provider you can enjoy the following features: ↔️Over 1,000,000 new exchange pair options ↔️Over 1,500 new tokens available for swap ↔️KYC/AML not required🔥 Enjoy the ability to easily exchange crypto between different networks via the new OKX DEX directly in the Tangem app. Swap now! 🛍Buy a cold wallet #Tangem with a 10% discount from our channel using the promo code: FG7L9X #Safepal#Ledger#Trezor#TON#OKX#DEX

😇EVAA Updates: New Integrations, Expanded Features & Security Focus 🪙Integration with SafePal EVAA is now available in the TON DeFi Collection section of the SafePal wallet. Through #TON Connect, users can work with basic assets, take and issue loans, as well as use lending in various LP pairs. The team has prepared a detailed text guide on connecting and using the protocol. ☕️Partnership with Swap Coffee The protocol is integrated into the Swap Coffee aggregator. In the #Yield tab, you can now: • track the current APR for EVAA pools; • deposit and withdraw assets; • manage deposits and loans. 🪙Temporary suspension of collateral in $CATI Since Friday, July 11, support for the $CATI token in the ALTs pool has been temporarily disabled due to low liquidity. All active positions are safe and not subject to liquidation; however, opening new collateral in $CATI is currently not allowed. This decision was made to increase the protocol's stability. 🛡Trail of Bits audit completed EVAA successfully passed the final stage of the audit at Trail of Bits. Despite recent criticism of this company's address due to an incident with another project, the #EVAA team emphasizes that reliability and transparency remain its priority. EVAA app | News | Chat | Website #EVAA#SafePal#CATI#Audit#Security#DeFi#Toncoin