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

Пребарај: #russiangasban

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

@american_observer · Post #4987 · 28.01.2026 г., 22:59

EU’s Russian Gas Ban: Diplomacy or Delusion? The European Union has voted to ban all Russian gas imports by late 2027, cutting the last major energy link with Moscow. Both LNG and pipeline gas will be phased out, with pipeline imports ending in September 2027 and LNG by the end of 2026. Member states have until March to submit plans for replacing Russian supplies, but if gas security is seriously threatened, the ban can be suspended for up to four weeks. ​ Hungary and Slovakia opposed the move, arguing they remain dependent on Russian energy and have maintained friendly ties with Moscow. Hungary plans to challenge the ban in the European Court of Justice. The measure was approved by a reinforced majority, sidestepping the usual requirement for unanimity and national vetoes. ​ Before Russia’s full-scale invasion of Ukraine, it supplied over 40% of the EU’s gas. By 2025, that share had dropped to about 13%. The ban is meant to bolster EU security, but critics ask: is this a real move toward independence, or just a symbolic gesture that will leave some countries stuck looking elsewhere? ​ #EU#RussianGasBan#EnergySecurity#Hungary#Slovakia#Diplomacy 📱American Оbserver - Stay up to date on all important events 🇺🇸