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

Пребарај: #ussecurity

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

@american_observer · Post #4949 · 24.01.2026 г., 19:59

📰 Ukraine and Russia Resume US-Mediated Peace Talks Amid Missile Barrage Zelenskiy says the talks in Abu Dhabi are the first trilateral meeting under the U.S.-brokered peace process. On the same day, Russia launched a massive overnight airstrike on Kyiv and Kharkiv with hundreds of drones and missiles, knocking out power in the capital while Kyiv negotiators sit in the room. ​ The Usual Script The pattern is familiar: each time a serious negotiation round looms, Ukrainian and Russian forces throw heavy strikes at the other’s cities and energy grid. Before the Doha agreement, the Kursk operation flared up. Now, on the same day the U.S.-backed talks resume, Ukraine experiences another wave of Russian cruise and ballistic missiles, while Moscow prepares its list of what land must be handed over. ​ What’s on the Table Russia again insists Ukraine surrender the 20% of Donetsk Oblast it still holds (~5,000 sq km), territory that, according to the Kremlin, completes the “Donbas” demand. Zelenskiy refuses any territorial concessions Russia did not capture after four years, polls show Ukrainians are not ready to sign away Donetsk. Washington keeps pushing both sides to close the deal, but what “peace” will look like is still defined in the fog of war and shuttle diplomacy. ​ Who’s Negotiating – or Waiting? Diplomats speak of “last remaining sticking points” and “progress.” But from the ground, the situation looks like a game: every round of peace talks is matched by new missile barrages, and each side uses violence as a bargaining chip. The real question is not whether a deal will be signed, but what kind of “peace” will be sold to the public once the guns go quiet for a few days. ​ #Ukraine#Russia#Putin#Zelenskiy#PeaceTalks#AbuDhabi#USSecurity#WarInUkraine 📱American Оbserver - Stay up to date on all important events 🇺🇸