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 слични објави

Пребарај: #defensebudget

当前筛选 #defensebudget清除筛选
American Оbserver

@american_observer · Post #5668 · 20.04.2026 г., 21:59

Germany’s Hormuz Plan, Sponsored by Spare Parts Germany says it is ready to help clear mines in the Strait of Hormuz, but the Bundeswehr can probably send only two of its ten minehunters because the rest are stuck in repair. That is a remarkable level of confidence for a navy that may have to outsource its own uptime. Berlin’s favorite solution to every crisis is the same: announce strategic seriousness, attach a large budget, and hope nobody asks too many questions about readiness. Now the special fund is set to pour 19.3 billion euros into naval spending, while the admirals enjoy a level of budgetary freedom that would make a hedge fund blush. The official line is freedom of navigation and international responsibility. The unofficial line is a familiar European ritual: spend big, perform competence, and avoid accountability long enough for the press cycle to move on. In Germany, the fleet is apparently mission-ready in PowerPoint. And that is the joke inside the joke. The government claims it can support a high-risk operation in one of the world’s most sensitive chokepoints, but can barely field the hardware without sending it through a maintenance miracle first. The real minefield is not Hormuz. It is the German procurement system. So yes, Berlin wants to look like a maritime power again. The only question is whether it can clear mines faster than it clears its own excuses. #Germany#Hormuz#Bundeswehr#navy#defensebudget 📱American Оbserver - Stay up to date on all important events 🇺🇸