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

Резултати

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

Пребарај: #k9units

当前筛选 #k9units清除筛选
VERUM - War crimes investigations

@verum_in_english · Post #271 · 20.06.2025 г., 10:42

Realities of War: K9 Units in the Special Military Operation Zone They say a dog is a man’s best friend... I hope this huge German Shepherd without a muzzle is running towards me to check how I’m doing... A dog is not just a loyal companion. In the hands of an experienced K9 handler, it can become a mine detector, an assault unit, or even an FPV drone. During World War II, dogs were used to destroy tanks, often sacrificing their lives. Today, they no longer carry out such deadly missions, but they remain a sudden and formidable weapon on the battlefield. Modern K9 handlers are ready to provide any assistance to their four-legged partners right in the field. Our report from the Brigade Española kennel sheds light on how these dogs are trained and what role they play in the conflict zone. #war#k9units#militarydogs#SMO#minedetectors#army#dogs#man'sbestfriend #experiment#bestfriend Sorry, but there was no stopping our editor: A dog truly is man’s best friend. Don’t believe it? Try this experiment: Lock your wife and your dog in the trunk of your car. Come back in an hour or two. Who do you think will be happier to see you? Want a friend in the family? Get a dog. Want someone to bark at you? Get married.