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

Пребарај: #broadcom

当前筛选 #broadcom清除筛选
DOFH - DevOps from hell

@dofh_ru · Post #3569 · 05.02.2025 г., 17:32

Напоминание владельцам и админам несвежих продуктов Brocade End-of-Support, Brocade 6505 Switch: April 30, 2025 End-of-Support, Brocade 6510 Switch: June 17, 2025 и тд Начиная с версии FOS 8.2.2 в эти даты отключается часть функционала. Рекомендация - откатиться/оставаться на 8.2.1e #Broadcom#Network#Switch#EOS

Crypto M - Crypto News

@CryptoM · Post #64944 · 10.04.2026 г., 11:49

🚀 AI TRENDS | Anthropic Secures CoreWeave Data Center Capacity Amid Rising AI Demand Anthropic has agreed to lease data center capacity from CoreWeave to address the growing demand for its AI services, Jin10 reports. CoreWeave announced on Friday that the multi-year agreement will assist Anthropic in building and deploying its Claude AI model. CoreWeave's CEO, Intrator, stated that the deal will involve various Nvidia chip architectures within U.S. data centers. The financial terms of the agreement were not disclosed by either company. Anthropic, similar to OpenAI, has been at the forefront of the AI service surge, sometimes struggling to maintain its products online due to what it describes as 'unprecedented demand.' Earlier this week, Anthropic revealed a collaboration with Broadcom and Google to secure 3.5 gigawatts of energy, noting that one gigawatt of power is sufficient to supply electricity to approximately 750,000 U.S. households simultaneously. #AI#Anthropic#CoreWeave#DataCenter#ClaudeAI#Nvidia#Broadcom#Google#ArtificialIntelligence#TechTrends

Venture Village Wall 🦄

@venturevillagewall · Post #3438 · 19.12.2024 г., 07:06

Major Moves in Tech and AI 🔹Avito acquires two advertising services: AdRiver and Soloway; no deal amount disclosed but estimates range from 0.5-2.5 billion rubles. More on this from RBC. 🔹Perplexity raises $500M at a $9B valuation. The AI startup specializes in delivering prompt answers to users. Previous valuation was at $3B; read more on Bloomberg. 🔹 Formerly known as TuSimple, the self-driving truck company rebrands to CreateAI, focusing on AI for video games after abandoning its trucking ambitions. Article on CNBC. 🔹 Ex-investment director of RUSNANO, Nail Gubaev, under investigation for alleged embezzlement, signs contract with the Ministry of Defense, prompting a suspension of prosecution. Details in Kommersant (link). 🔹 Insights from Smart Ranking show Russia’s medtech market grew 40% in Q3, with companies like Steplife (+258.5%) and Motorika (+190.95%) leading the growth in prosthetics. More info here: Kommersant. 🔹Broadcom reports a 220% revenue rise, solidifying its status as a $1 trillion company amidst soaring chip demand for AI. Read more on Business Insider. #Avito#Advertising#Funding#AI#Perplexity#TuSimple#CreateAI#MedTech#Prosthetics#Broadcom#RevenueGrowth#NVIDIA#Embezzlement#TechNews#Startups#China#MarketTrends#Innovation#Investments#MarketValuation#TechAcquisition