Мы уже знаем, что на текущую сессию интерпретатора изменение 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
🔥NEW RELEASE🔥
😁Forging The Guard: Mastering Foundation's Of The Clamp By Giancarlo Bodoni😁
➡️Unlock the secret to dominating your opponent with Giancarlo Bodoni’s "Forging the Guard: Mastering Foundations of the Clamp". As a 2x ADCC champion, training partner of Gordon Ryan, and student of John Danaher, Giancarlo brings you an exclusive BJJ instructional that dives deep into the world of the Clamp Guard
➡️In this series, Giancarlo breaks down the foundational elements of the Clamp Guard, a unique guard that allows for seamless sweeps, submissions, and positional control.
➡️Whether you're a beginner or an experienced practitioner, this instructional will elevate your guard game by showing you how to lock your opponent down, maintain dominant control, and transition fluidly into devastating attacks.
$197😍$19.99😍
❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️
📱Payment: 📱📱📱
💰Submeta FOR FREE
🌈UFC Picks
👑MasterClass
✈️@bjjfanaticsinstructionals
#GiancarloBodoni#BJJFanatics#NewWave#NoGi
💁♀️Buy
💁♀️
😁See the Back Take The Back: Guard Passes To Back Takes by Giancarlo Bodoni😁
➡️See the Back, Take the Back: Guard Passes to Back Takes by Giancarlo Bodoni is the definitive blueprint for turning pressure passing into relentless back-taking offense.
➡️As a 2× ADCC champion, CJI standout, and one of the most technically disciplined athletes to emerge from the legendary Danaher system, Giancarlo has built his game around one thing: getting to the back and finishing—against everyone.
$197😍$14.99😍
❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️
📱Payment: 📱📱📱
💰Submeta FOR FREE
👑MasterClass
✈️@bjjfanaticsinstructionals
#GiancarloBodoni#Transitions#NoGi#NewWave
💁♀️Buy
💁♀️
😁Submission Mastery: Omoplata by Giancarlo Bodoni😁
➡️Giancarlo Bodoni — 2x ADCC champion, CJI standout, and elite New Wave athlete under the legendary John Danaher and Gordon Ryan — unveils his groundbreaking system for mastering one of grappling’s most underutilized weapons: the omoplata.
➡️This is not just a submission tutorial. This is a total redefinition of the omoplata for the modern no-gi game — built on elite-level mechanics, control, and finishing options that go far beyond what you thought possible.
$197😍$14.99😍
❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️
📱Payment: 📱📱📱
💰Submeta FOR FREE
👑MasterClass
✈️@bjjfanaticsinstructionals
#GiancarloBodoni#Submission#NoGi#NewWave
💁♀️Buy
💁♀️
😁Forging The Guard: Reverse De La Riva By Giancarlo Bodoni😁
➡️Unlock the full potential of your guard game with Forging The Guard: Reverse De La Riva by Giancarlo Bodoni, a two-time ADCC champion and one of the most successful no-gi athletes on the planet.
➡️This comprehensive instructional series takes you deep into the intricacies of the Reverse De La Riva Guard, a position renowned for its versatility, control, and offensive potential
➡️Giancarlo breaks down each detail with clear, concise direction that will help you build a nearly impenetrable guard while simultaneously making you a constant threat from this powerful position.
$197😍$16.99😍
❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️
📱Payment: 📱📱📱
💰Submeta FOR FREE
🌈UFC Picks
👑MasterClass
✈️@bjjfanaticsinstructionals
#GiancarloBodoni#NoGi#ReverseDeLaRiva
💁♀️Buy
💁♀️
😁Forging The Guard: De La Riva By Giancarlo Bodoni😁
➡️Unlock the full potential of your guard game with Forging The Guard: De La Riva by Giancarlo Bodoni, a two-time ADCC champion and one of the most successful no-gi athletes on the planet.
➡️This comprehensive instructional series dives deep into the classic De La Riva Guard, a position known for its incredible control, sweeping power, and submission potential.
➡️Giancarlo provides clear and concise direction that will help you elevate your guard to a nearly impassable level while making you a constant offensive threat.
$197😍$16.99😍
❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️
📱Payment: 📱📱📱
💰Submeta FOR FREE
🌈UFC Picks
👑MasterClass
✈️@bjjfanaticsinstructionals
#GiancarloBodoni#NoGi#DeLaRiva
💁♀️Buy
💁♀️
🔥NEW RELEASE🔥
😁Forging the Guard: Wrestle Ups by Giancarlo Bodoni😁
➡️Giancarlo Bodoni, one of the most dominant grapplers on the planet and a top student of the legendary John Danaher, brings you a game-changing instructional designed to reframe how you think about reversals from the bottom.
➡️In Forging the Guard: Wrestle Ups, Giancarlo reveals how to seamlessly blend traditional BJJ guard positions with low-effort, high-reward wrestle ups—turning common situations into powerful sweeps and takedowns.
̶$̶1̶9̶7̶😍$14.99😍
❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️
📱Payment: 📱📱📱
💰Submeta FOR FREE
🌈UFC Picks
👑MasterClass
✈️@bjjfanaticsinstructionals
#GiancarloBodoni#WrestleUp#NoGi#NewWave
💁♀️Buy
💁♀️