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

Резултати

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

Пребарај: #romania

当前筛选 #romania清除筛选
POPULAR FRONT

@popularxfront · Post #4196 · 18.12.2025 г., 23:46

🇷🇴#Romania: Archival footage from the Romanian Revolution of December 1989 captures armed clashes between rebels, government forces, and so-called terrorists. The uprising began in Timișoara after authorities attempted to evict Hungarian pastor Tőkés, sparking protests that escalated nationwide. The regime responded by ordering live fire against civilians, resulting in hundreds of deaths. However, parts of the army switched sides, and after Ceaușescu’s control collapsed (Communist Romania's leader), authorities claimed the country was under attack by foreign agents. Chaos ensued, with armed civilians, Securitate agents (Romanian KGB), and army units clashing, leading to friendly fire and panic, with passersby often labeled as terrorists. The violence subsided rapidly after Ceaușescu’s execution and consolidation of power by the National Salvation Front. The alleged terrorists vanished, gunfire declined, and investigations stalled. To this day, the true elements responsible for the deaths remain unknown.

Hashtags

Voyage.Travel.Tourism

@VOYAGE · Post #1705 · 31.03.2026 г., 12:14

Romania🇷🇴 ✅ Romania is a classic European country known for its beautiful beaches, stunning nature, and famous ski resorts. If you prefer a calm and relaxed vacation, this is a great option. ✅ While Romania may not be the wealthiest country in Europe, interest in it has significantly grown in recent years. With plenty of sunshine, clear seas, and beautiful mountains, it offers many attractions. Highlights include well-preserved medieval castles and picturesque national parks. #Romania | @voyage

Hashtags

Voyage.Travel.Tourism

@VOYAGE · Post #1173 · 24.11.2024 г., 13:14

ROMANIA🇷🇴 ✅ Romania is a classic European country known for its beautiful beaches, stunning nature, and famous ski resorts. If you prefer a calm and relaxed vacation, this is a great option. ✅ While Romania may not be the wealthiest country in Europe, interest in it has significantly grown in recent years. With plenty of sunshine, clear seas, and beautiful mountains, it offers many attractions. Highlights include well-preserved medieval castles and picturesque national parks. #Romania @voyage

Hashtags

BAZUKA

@jbazuka · Post #116 · 07.07.2022 г., 05:53

🇷🇴#RomaniaНа западе Румынии горит пшеничное поле ⚠️☝️ 💬 Огонь охватил около 100 га. Причиной, предположительно, стала сильная жара: последние дни температура воздуха тут достигает +40 °С. 💬 Местные предполагают, что на самом деле это спланированное уничтожение пшеничного поля, чтобы создать искуственный голод!

Hashtags

Interesting Planet 🌍

@interesting_planet_facts · Post #1230 · 17.01.2026 г., 12:11

🌎 Deep inside Romania’s Apuseni Mountains, the Scarisoara Ice Cave contains one of the oldest and largest underground glaciers in the world. The ice block is over 3,500 years old and reaches about 26 meters thick. ✨ #caves⚡#geology⚡#Romania 👉subscribe Interesting Planet 👉more Channels ​

POPULAR FRONT

@popularxfront · Post #5150 · 27.02.2026 г., 19:48

🇺🇦#Ukraine / 🇷🇴#Romania - 🇷🇺#Russia: Footage shows a Russian Shahed drone being shot down by Ukrainian air defence over the Danube River in Odesa Oblast this morning. The video was filmed from the Romanian side of the border, showing just how close these drones are flying next to neighbouring countries. Over the past years, there have been multiple incidents of such drones crashing into Romanian territory. (📹 via @Archer83Able on X)

Tutto Elezioni

@tuttoelezioni · Post #999 · 18.05.2025 г., 18:29

#Romania🇷🇴 #Presidenziali 🕗Ore 20:00 italiane (21:00 ora locale). Affluenza parziale (dati interni ed esteri): 64,72% (+11,51% rispetto al primo turno). Affluenza parziale (solo dati interni): 55,57% (+7,77% rispetto al primo turno). @TuttoElezioni

123•••10•••1415
ПретходнаСтраница 1 од 15Следна