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

Резултати

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

Пребарај: #caves

当前筛选 #caves清除筛选
Interesting Planet 🌍

@interesting_planet_facts · Post #1376 · 17.04.2026 г., 12:11

🌎 In Slovenia, the Postojna Cave harbors a rare blind amphibian called the olm, which can live without food for up to 10 years. The cave stretches over 24 kilometers and contains vast chambers, underground rivers, and prehistoric animal remains. ✨ #geology⚡#caves⚡#biodiversity 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1167 · 26.12.2025 г., 22:11

🌎 Beneath Borneo’s limestone hills, the Clearwater Cave system spans over 237 kilometers, making it one of the world’s largest interconnected cave networks. Its underground river flows for 11 kilometers, supporting unique species like blind catfish and swiftlets that nest in its dark chambers. ✨ #caves⚡#geology⚡#biodiversity 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1080 · 28.11.2025 г., 12:11

🌎 The world’s deepest cave, Veryovkina Cave in Georgia, plunges to 2,212 meters below the surface. Its vertical shafts, tight squeezes, and frigid underground streams challenge expert cavers. Specially adapted crustaceans and fungi live in total darkness at these extreme depths. ✨ #caves⚡#geology⚡#biodiversity 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #704 · 07.09.2025 г., 13:22

🌎 In Croatia’s Velebit Mountains, the Lukina Jama–Trojama cave system plunges over 1,431 meters deep, housing rare leech species and tiny amphipods. Exploring these deep caves requires specialized rope techniques and careful study of underground water flows, revealing new life forms adapted to total darkness and isolation. ✨ #caves⚡#biodiversity⚡#geology 👉subscribe Interesting Planet ​

Interesting Planet 🌍

@interesting_planet_facts · Post #669 · 01.09.2025 г., 16:22

🌎 Deep beneath Venezuela, the Cueva del Fantasma cave is so massive that helicopters can fly inside. These vast underground chambers shelter unique bats, insects, and even entire ecosystems far from sunlight. ✨ #caves⚡#geology⚡#biodiversity 👉subscribe Interesting Planet ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1288 · 12.02.2026 г., 12:11

🌎 The world’s largest crystal cave, Cueva de los Cristales in Mexico, holds giant selenite crystals that measure up to 12 meters long. These crystals formed over 500,000 years in intense heat and humidity more than 300 meters below the surface. ✨ #minerals⚡#geology⚡#caves 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1139 · 17.12.2025 г., 22:11

🌎 Deep inside Lechuguilla Cave in New Mexico, explorers have found rare mineral formations called "subaqueous helictites." These twisted crystals form underwater from mineral-rich drips, creating shapes never seen elsewhere. The cave stretches over 248 kilometers, making it one of the longest surveyed caves in the world. ✨ #geology⚡#caves⚡#minerals 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #556 · 14.08.2025 г., 00:22

🌎 Deep within Mexico’s Cave of Swallows, birds plunge over 370 meters in freefall—a vertical drop so vast, entire skyscrapers could fit inside. This limestone sinkhole is among the world’s largest cave shafts, showcasing nature’s dramatic underground architecture. ✨ #geology⚡#birds⚡#caves 👉subscribe Interesting Planet

Interesting Planet 🌍

@interesting_planet_facts · Post #535 · 10.08.2025 г., 16:22

🌎 Salt crystals can form “cave chandeliers” in arid underground lakes. These sparkling formations grow when salty water evaporates, leaving dazzling, fragile mineral structures hanging from cave ceilings. ✨ #geology⚡#caves⚡#minerals 👉subscribe Interesting Planet

Interesting Planet 🌍

@interesting_planet_facts · Post #1009 · 06.11.2025 г., 12:11

🌎 Hidden deep beneath the Yucatán Peninsula in Mexico, the Sistema Sac Actun is the world’s longest underwater cave system. Stretching over 370 kilometers, these flooded limestone tunnels were formed by rainwater dissolving rock over thousands of years. Archaeologists have found ancient human and animal fossils preserved in the caves, including remains over 13,000 years old. ✨ #caves⚡#archaeology⚡#fossils 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #771 · 18.09.2025 г., 00:22

🌎 Deep inside Mexico’s Naica Mine, giant crystals of gypsum grow in the Cave of the Crystals, reaching up to 11 meters long. The cave’s extreme heat—up to 58°C—and high humidity make exploration challenging, and the crystals formed over at least 500,000 years in mineral-rich underground water. ✨ #caves⚡#crystals⚡#geology 👉subscribe Interesting Planet ​

Amazing Geography 🌍

@amazingeo · Post #577 · 15.01.2026 г., 12:31

🌍 Slovenia’s Škocjan Caves feature an underground canyon over 100 meters deep—the largest in Europe. This karst wonder drains rivers directly from the surface into vast hidden chambers. ✨ #caves⚡#karst⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

ПретходнаСтраница 1 од 4Следна