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

Резултати

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

Пребарај: #enceladus

当前筛选 #enceladus清除筛选
Universe Mysteries 🪐

@cosmomyst · Post #674 · 11.02.2026 г., 22:21

🪐 Beneath the icy surface of Saturn's moon Enceladus, scientists have found clear evidence of a global subsurface ocean of salty water. Powerful geysers shoot out water vapor and ice particles from cracks called "tiger stripes," revealing the presence of liquid water kept warm by heat from the moon's core—making Enceladus one of the most promising places to search for life beyond Earth. ✨ #Enceladus⚡#moons⚡#oceans⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #82 · 05.08.2025 г., 00:11

🪐 Saturn’s tiny moon Enceladus harbors a global ocean beneath its icy crust, and scientists have detected plumes of salty water and organic molecules—building blocks of life—eruption from cracks near its south pole. These discoveries suggest that Enceladus may offer the right conditions for simple life to exist, hidden far below the frozen surface. ✨ #Enceladus⚡#astrobiology⚡#ocean⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries

Universe Mysteries 🪐

@cosmomyst · Post #559 · 15.12.2025 г., 12:21

🪐 The only confirmed ingredient for life beyond Earth so far is in the form of organic molecules—carbon-based chemicals—found on Saturn’s moon Enceladus. Data from the Cassini spacecraft revealed plumes of water vapor, methane, and complex organic compounds spraying from cracks in the moon’s icy surface, providing real evidence that some ingredients for life are scattered throughout our solar system as we continue the search for actual alien organisms. ✨ #aliens⚡#Enceladus⚡#organics⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​