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

Резултати

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

Пребарај: #dobroye

当前筛选 #dobroye清除筛选
DruschbaFM - English

@druschbaFm_en · Post #51966 · 12.03.2025 г., 08:02

⚡️🇷🇺🇺🇦⚡️ Two Majors #Summary for the Morning of 12 March 2025; 06:27 (GMT+3)⚡️ 🔹 The Russian Army continues its #Kursk offensive with decisive objectives. Yesterday, #KazachyaLoknya, #Zamostye, #Makhnovka, #Mirny, #Bondarevka, #Dmitryukov, and #Knyazhy1st and #Knyazhy2nd hamlets were liberated. Russian forces are advancing from #Sudzha’s industrial zone and central market, with reports of movement in the built-up areas. Footage has emerged of Ukrainian infantry retreating westward. Russian troops are also active in the #Sumy region near #Zhuravka. The #Sudzha – #Yunakovka Motorway is under Russian fire control, and AFU reinforcements attempting to enter the #Kursk region have been repelled. Heavy battles for the region’s liberation continue. 🎯 Russian Forces struck targets in #Odessa region overnight, with the enemy claiming a 'cargo ship carrying grain' was damaged. Confirmed strikes hit infrastructure in #Dnepropetrovsk, with explosions reported in #Kiev, #Pavlograd, #Kramatorsk, #SnakeIsland, as well as in the #Cherkassy, #Kharkov, #Sumy, and #Khmelnitsky regions. 🛡 Russian Air Defences repelled a night-time attack on the #Bryansk region. 🔹 In #Seversk Sector, Russian forces continue difficult advances west of #Belogorovka, facing fierce and organised 👉resistance. 🔹 In #Toretsk, reports persist of AFU units being deployed deeper into urban areas. 🔹 In #Pokrovsk Direction, clashes continue in #Shevchenko, #Peschanoye, #Kotlino, and #Uspenovka. On the far right flank, east of #Pokrovsk, Russian forces are attacking near #Tarasovka. 🔹 On the #Vremyevka Ledge, north of #VelikayaNovosyolka, the 'East Group of Troops' has secured #Dneprenergiya. The enemy claims successful counterattacks in #Novosyolka. 🔹 On the #Zaporozhye Front, Russian forces raised the flag over #Pyatikhatki after prolonged heavy battles.🎬👆The village, situated in a low-lying area, has been in ruins since summer 2023 and lacks underground shelters, making long term consolidation uncertain. 💥 In #Belgorod Region, the AFU continues to target civilians. In Shebekino district, a UAV attack damaged equipment at a commercial facility in #Dobroye. In #Shamino, an FPV drone struck a civilian car. Another drone hit a private residence in #NizhneyeBeryozovo2nd. In Grayvoron district, a UAV detonation in a private residence in #Glotovo caused an attic fire. In #Valuyki, an FPV drone damaged a car and shattered windows. In #Shelayevo, a drone exploded on the ground. 💥 In the #DPR, a 2001-born woman was injured in #Gorlovka following a Nazi artillery strike, with further damage to civilian infrastructure. In #KrasnayaPolyana, Volnovakha district, a 1966-born man sustained injuries from an explosive device detonation. 💬Welcome to Military Chat; 🇬🇧Battle Maps 📱 Join GLOBAL DEPTH to boost your TG Feed GLOBAL DEPTH from #HK This channel aims to unite interested individuals from around the world in an attempt to connect the dots. Subscriber participation is always welcome here and in the channel's Chat Group.