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

Резултати

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

Пребарај: #endthesiege

当前筛选 #endthesiege清除筛选
Freedom Flotilla Coalition

@FFC_official_channel · Post #282 · 22.05.2025 г., 08:57

We will sail. Since our ship was attacked on May 2, Israel has killed nearly 2,000 more Palestinians. Meanwhile, 14,000 babies now face imminent death from hunger due to Israel’s deliberate starvation campaign. This is the cost of global impunity. But we refuse to back down. The ‘Madleen’ will sail soon. She may be small, but her mission is powerful: To break the silence. To challenge Israel’s illegal blockade through nonviolent direct action. To stand firmly and unapologetically, with Gaza. JOIN US. Registrations are open for experienced and committed captains, crew, volunteers, and boat owners. You will be vetted and contacted only if successful: https://bit.ly/joinfreedomflotillaform To those who can help us on land, sign our petition for an investigation into the attacks, demand your governments ensure safe passage for the 'Madleen’, and share this journey - because the more eyes on us, the safer we are. #WeWillSail#Madleen#Conscience#FreeGaza#EndTheSiege#AllEyesOnDeck#StopArmingIsrael

Freedom Flotilla Coalition

@FFC_official_channel · Post #661 · 21.07.2025 г., 11:20

Amazon Labor Union leader Chris Smalls is on the 'Handala', the 37th ship to challenge Israel’s illegal siege on Gaza. Amazon has invested billions in intelligence like the Nimbus project, used for the surveillance and targeting of Palestinians. Chris shares that “…an injury to one is injury to all,” calling on labor unions worldwide to fulfill their responsibility: to be the shield for the working class, which includes protecting Palestinian people, and urges unions to stop their shipments of arms to Israel, fuelling their genocide in Gaza. “We come with baby food, toys, medicine, and hope — not just for Gaza, but for the future of our children in America back at home. The world is watching.” #FreePalestine#LaborForPalestine#EndTheSiege#Handala#UnionSolidarity#GazaFlotilla#AmazonComplicity