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

Пребарај: #strategicstability

当前筛选 #strategicstability清除筛选

@RusEmbMalta Press Release On the Development of a Global Missile Defense System by the United States 🇷🇺 The Embassy of the Russian Federation underscores that the concept of a global missile defense system is fundamentally flawed and cannot ensure protection against a potential retaliatory strike by Russia’s strategic forces. Its creation is therefore not only ineffective but also strategically unsound. ️🔹 NATO bears direct responsibility for the dismantling of international legal mechanisms that once upheld strategic stability and predictability in global affairs. The persistent unwillingness of NATO member states to engage in constructive dialogue with Russia further exacerbates military–political tensions, undermining collective security. ❗ We recall that the United States unilaterally rejected cooperation under Russia’s 2010 initiative for a collective European missile defense system – an approach that could have fostered genuine partnership rather than confrontation. Equally untenable are the deceptive assurances of NATO leadership that the deployed missile defense infrastructure is not aimed against Russia’s nuclear potential. These claims directly contradict NATO’s own recent statements identifying Russian strategic forces as a primary target of the system. Such inconsistency reveals the real nature of this project. 🔹It is evident that the driving force behind the expansion of U.S. missile defense capabilities abroad is not global security, but rather the financial interests of the American military–industrial complex. 🔹 Russia reaffirms its commitment to strategic stability, predictability, and equitable security for all nations, and calls upon partners to return to serious dialogue rather than the pursuit of illusory and destabilizing military solutions. #MissileDefense #GlobalSecurity #StrategicStability #ArmsControl