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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #201 · 13 јан.

Мы уже знаем, что на текущую сессию интерпретатора изменение PYTHONPATH никак не повлияет. Но если вы запустите дочерний процесс, то он унаследует окружение текущего процесса, а значит и изменения в любых переменных будут на него влиять. Вот небольшой пример: Объявляем переменную user@host:~$ export PYTHONPATH=/path1 Запускаем интерпретатор user@host:~$ python3 Проверим что в sys.path >>> import sys >>> print(sys.path) ['', '/path1', '/usr/lib/...', ...] Добавляем что-то в переменную >>> import os >>> os.emviron['PYTHONPATH'] = '/path1:/path2' >>> print(sys.path) ['', '/path1', '/usr/lib/...', ...] Изменений нет. Но давайте запустим дочерний процесс и посмотрим там >>> os.system('python3') # теперь мы находимся в другом процессе >>> import sys >>> print(sys.path) ['', '/path1', '/path2', '/usr/lib/...', ...] Тоже самое будет и с subprocess, так как по умолчанию текущее окружение тоже наследуется. >>> import subprocess >>> subprocess.call(['python3', '-c', 'import sys;print(sys.path)']) ['', '/path1', '/path2', '/usr/lib/...', ...] ______________________ Лучшей практикой является передача энвайронмента явно через аргумент env! import subprocess subprocess.call(cmd, env={'PYTHONPATH': '...'}) Это поможет точно понимать какое окружение будет у запускаемого процесса и при этом не изменять окружение текущего процесса. #basic

Hashtags

Резултати

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

Пребарај: #tongateway

当前筛选 #tongateway清除筛选

💰New Stablecoins in the TON & Telegram Ecosystem Last year was marked by the successful launch of TON-USDT, which became the most successful in Tether's history, with over 100 integrations, including payment of government fees in the Philippines. At the #TonGateway conference in November, they talked about new stablecoins that are preparing to launch: 🕗USDe from Ethena $USDe launch on TON announced, confirmed by verified contract. #Ethena is the largest DeFi protocol on #Ethereum with TVL of ~$5 billion, ready to increase liquidity and development #DeFi on TON. 🪙UAE Dirham from Tether (AED₮) Tether has announced the launch of a stablecoin pegged to #UAE dirham on TON. This will be the first digital dirham backed by liquid reserves in the UAE and backed by the Central Bank of the UAE. 🪙CRVUSD by Curve Curve Finance, with a TVL of ~$2.5 billion, is considering launching its $crvUSD stablecoin on $TON. The project has been consulting with other projects on implementing its technology, and while nothing has been confirmed, rumors continue. 💲USDC by Circle After adding TON to #MoonPay, introducing mandatory KYC for some key products in the #Telegram ecosystem, the arrival of $USDC will most likely not be long in coming. 🪙tgUSD by Torch Finance Torch Finance, backed by Ton Foundation and TVM Ventures, announced tgUSD, with the ability to pay via Torch Pay. This is a young project, but with serious support and prospects. The launch of more than five stablecoins will give TON a foundation for multi-currency DeFi, increase liquidity, and expand opportunities for ecosystem users.