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

Пребарај: #web3ua

当前筛选 #web3ua清除筛选
Crypto Drop Club

@drop_cryptogo · Post #1809 · 19.05.2025 г., 12:05

🎮TapSwaphas reached a new level - beta is already online! Now skill games are available to the first users directly in Telegram. No downloads - everything is fast, convenient and already with $TAPS integration . What's in beta: • 🎮 3 play-to-skill games — it’s not clicks that matter, but real skill • 💸 Using and testing $TAPS in action • 🧩 Convenient Telegram mini-app — launch in a couple of seconds ⚠️Beta is available only to a limited number of users. If you've gained access, you're among the first to test the mechanics before the mass launch and possibly earn an advantage. 📅 Public release - already in early June. Get ready:TapSwapis a game changer. #TapSwap#CryptoGaming#SkillToEarn#Web3UA Bot link:tapswap_bot📱 Crypto Drop Club 👉 SUBSCRIBE

Nigeria Football Hub

@football_nigeria · Post #1098 · 19.05.2025 г., 14:01

🎮TapSwap officially launched the beta! The project has made an important step forward — now skill games are available for the first testers directly in Telegram. Convenient format, fast loading and no unnecessary actions. What's included in the beta: • 🎯 Three games where the outcome depends on your skills • 💰 Integration with $TAPS • 📲 Access via Telegram mini-app ⚠️ At the current stage, only selected users have access to the beta. If you are among them, you can already try out the platform before the official release. 🗓The public launch is scheduled for early June. #TapSwap#БетаЗапуск#SkillGaming#Web3UA Bot link:tapswap_bot📱 Nigeria Football Hub

INSIDER USA | News

@insider_usa_news · Post #3352 · 19.05.2025 г., 13:04

🎮TapSwap officially launched the beta! The project has made an important step forward — now skill games are available for the first testers directly in Telegram. Convenient format, fast loading and no unnecessary actions. What's included in the beta: • 🎯 Three games where the outcome depends on your skills • 💰 Integration with $TAPS • 📲 Access via Telegram mini-app ⚠️ At the current stage, only selected users have access to the beta. If you are among them, you can already try out the platform before the official release. 🗓The public launch is scheduled for early June. #TapSwap#БетаЗапуск#SkillGaming#Web3UA Bot link:tapswap_bot📱 INSIDER USA 👉🏻 Subscribe