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

Резултати

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

Пребарај: #supremeleader

当前筛选 #supremeleader清除筛选
Crypto M - Crypto News

@CryptoM · Post #65253 · 12.04.2026 г., 10:35

🚀 Iran's Foreign Policy Focuses on National Protection, Adviser States Iran's Supreme Leader's foreign affairs adviser, Velayati, stated on his social media platform on the 12th that Iran's foreign policy consistently adheres to the principle of 'protecting our homeland.' According to Odaily, he emphasized that control over the Strait of Hormuz is firmly in Iran's hands. #Iran#ForeignPolicy#NationalProtection#StraitOfHormuz#Velayati#SupremeLeader#HomelandProtection

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40796 · 14.03.2026 г., 20:05

Mojtaba Khamenei became Supreme Leader of Iran after his father, Ali Khamenei, was killed in a U.S.–Israeli airstrike. He leads with hard-line policies, controlling the military, security forces, and political decisions. For ordinary Iranians, this means strict government control, limited political freedom, limited internet, harsh enforcement of laws, and continued tensions with the West. Daily life and dissent will likely remain tightly restricted under his rule. 🕌🇮🇷⚔️ [Read more] @googlefactss #Iran#MojtabaKhamenei#SupremeLeader#politics#newsfacts#freeIran#protests#womensrights

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40731 · 03.03.2026 г., 17:02

Ali Hosseini Khamenei was born on 19 April 1939 in Mashhad, Iran. He was a Shiite cleric and political leader. He took part in the 1979 Iranian Revolution. He later became President of Iran from 1981 to 1989 during the Iran–Iraq War. On 4 June 1989, after the death of Ruhollah Khomeini, he was chosen as the 2nd Supreme Leader of Iran. He held this role until 28 February 2026. As Supreme Leader, he had authority over the military, judiciary, state media, intelligence services, and foreign policy. He oversaw Iran’s nuclear program and strengthened the Islamic Revolutionary Guard Corps. His government carried out crackdowns on protests and dissent. He was reported killed on 28 February 2026 during Israeli missile attacks in Tehran. His death was confirmed on 1 March 2026. His son is replacing him. 🏛️🇮🇷📜 [Read more] @googlefactss #AliKhamenei#Iran#SupremeLeader#dictator#IranHistory#MiddleEast#freeIran#LiberateWomen#protest