TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #201 · 13 јан.

Мы уже знаем, что на текущую сессию интерпретатора изменение PYTHONPATH никак не повлияет. Но если вы запустите дочерний процесс, то он унаследует окружение текущего процесса, а значит и изменения в любых переменных будут на него влиять. Вот небольшой пример: Объявляем переменную user@host:~$ export PYTHONPATH=/path1 Запускаем интерпретатор user@host:~$ python3 Проверим что в sys.path >>> import sys >>> print(sys.path) ['', '/path1', '/usr/lib/...', ...] Добавляем что-то в переменную >>> import os >>> os.emviron['PYTHONPATH'] = '/path1:/path2' >>> print(sys.path) ['', '/path1', '/usr/lib/...', ...] Изменений нет. Но давайте запустим дочерний процесс и посмотрим там >>> os.system('python3') # теперь мы находимся в другом процессе >>> import sys >>> print(sys.path) ['', '/path1', '/path2', '/usr/lib/...', ...] Тоже самое будет и с subprocess, так как по умолчанию текущее окружение тоже наследуется. >>> import subprocess >>> subprocess.call(['python3', '-c', 'import sys;print(sys.path)']) ['', '/path1', '/path2', '/usr/lib/...', ...] ______________________ Лучшей практикой является передача энвайронмента явно через аргумент env! import subprocess subprocess.call(cmd, env={'PYTHONPATH': '...'}) Это поможет точно понимать какое окружение будет у запускаемого процесса и при этом не изменять окружение текущего процесса. #basic

Hashtags

Резултати

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

Пребарај: #grasslands

当前筛选 #grasslands清除筛选
Amazing Geography 🌍

@amazingeo · Post #495 · 05.12.2025 г., 12:31

🌍 The Mongolian steppes have supported nomadic herding for centuries, with grasslands shaped by grazing animals and seasonal movement. This partnership keeps both wildlife and pastures thriving naturally. ✨ #nature⚡#society⚡#grasslands⚡#geography⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #621 · 08.02.2026 г., 20:31

🌍 Temperate grasslands like the Eurasian steppes can experience temperature swings of over 40°C between summer and winter, creating some of the planet’s most extreme seasonal contrasts. ✨ #grasslands⚡#savanna⚡#climate⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #475 · 25.11.2025 г., 12:31

🌍 The Pampas grasslands in South America are so fertile they support one of the world’s largest cattle industries and can produce up to seven harvests of grass each year, fueling global food markets. ✨ #grasslands⚡#agriculture⚡#SouthAmerica⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #583 · 20.01.2026 г., 20:31

🌍 Africa’s Miombo savanna covers over 2.7 million square kilometers—about the size of Argentina. Its woodlands support hundreds of unique butterfly species found nowhere else on Earth. ✨ #savanna⚡#grasslands⚡#ecosystems⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #434 · 04.11.2025 г., 20:31

🌍 Some grassland plants grow deep roots reaching over 2 meters underground. These roots help the plants survive drought and anchor soil, making grasslands some of the most erosion-resistant landscapes. ✨ #grasslands⚡#savanna⚡#ecology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #242 · 15.09.2025 г., 16:12

🌍 Grasslands cover about 40% of Earth’s land surface and are found on every continent except Antarctica. Some of the world’s richest soils, called mollisols, form in temperate grasslands. ✨ #grasslands⚡#savanna⚡#soil⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #398 · 21.10.2025 г., 12:31

🌍 Some grassland soils are so fertile they can support crops for decades without added fertilizer. These deep, dark soils store huge amounts of carbon, helping stabilize the global climate. ✨ #grasslands⚡#soil⚡#carbon⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #704 · 30.04.2026 г., 20:31

🌍 Argentina’s Pampas are vast temperate grasslands that grow some of the world’s richest soils. These grasslands support massive cattle herds and store huge amounts of carbon underground. ✨ #grasslands⚡#pampas⚡#carbon⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​