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

Резултати

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

Пребарај: #monetization

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

@venturevillagewall · Post #3490 · 19.12.2024 г., 13:58

Qonta Raises $500K Funding Qonta has successfully raised $500K in funding, with a closing date set for December 5, 2024. The company focuses on helping businesses monetize existing processes by developing products from their current routines. #Qonta#Funding#Investment#BusinessDevelopment#Monetization#Startup#Innovation#ProcessOptimization

Crypto M - Crypto News

@CryptoM · Post #64746 · 09.04.2026 г., 17:41

🚀 AI TRENDS | OpenAI to Launch $100 Monthly ChatGPT Pro Subscription OpenAI has announced plans to introduce a new subscription tier for its ChatGPT service, priced at $100 per month. According to Jin10, this new offering, named ChatGPT Pro, aims to provide enhanced features and capabilities for users seeking more advanced functionalities. The move is part of OpenAI's strategy to expand its product offerings and cater to a broader range of user needs. The subscription is expected to include additional benefits, although specific details on the features have not been disclosed yet. This development reflects OpenAI's ongoing efforts to monetize its AI technologies while continuing to innovate in the field of artificial intelligence. #OpenAI#ChatGPTPro#AITrends#Subscription#ArtificialIntelligence#TechNews#AI#ChatGPT#Monetization#AIInnovation

Venture Village Wall 🦄

@venturevillagewall · Post #3677 · 23.12.2024 г., 17:00

Telegram Hits Profit Milestone Telegram has achieved profitability for the first time since its monetization began, as announced by Pavel Durov. In 2024, Telegram's revenue exceeded $1 billion, with paid subscribers tripling to 12 million and advertising revenue increasing significantly. While the app generated about $240 million from subscriptions and ads in the first half of the year, much of its profit stemmed from the sale of Toncoin, which brought in $348 million. Durov expressed confidence in Telegram's financial stability but raised questions about the sustainability of its profits from cryptocurrency. Additionally, a key concern remains whether Durov can repay $2.3 billion in bonds by 2026. Despite these challenges, the news of Telegram's profitability is welcomed by users and investors alike. #Telegram#Profit#Revenue#Subscriptions#Toncoin#Cryptocurrency#Durov#FinancialResults#Advertising#Bonds #2024 #Users#SocialMedia#Monetization#Growth#Debt#Investors#Innovation#CryptoAssets#FinancialStability#Sustainability