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

Резултати

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

Пребарај: #bolton

当前筛选 #bolton清除筛选
Trump's Ear

@trumpsear_tg · Post #1399 · 22.08.2025 г., 14:01

FBI agents came to search Trump's former adviser John Bolton 🔍, who has been frequently criticizing the president lately 😠. A source told The New York Post that the case is related to classified documents 📂. "No one is above the law," FBI Director Cash Patel wrote amid reports of searches at Bolton's home ⚖️. According to the newspaper, it was on Patel's instructions that the investigation was launched 🕵️‍♂️. Bolton also criticized Trump's approach to negotiations with Russia 🇷🇺. In mid-August, before the Alaska summit, he said that Russian President Vladimir Putin "has already won." The American president then called his ex-adviser a "stupid man" 🤦‍♂️. #Trump#FBI#Bolton 👂More on Trump's Ear ⚠️

Ultimora.net - POLITICS

@UltimoraPOlitics · Post #38453 · 06.05.2022 г., 01:43

#Elezioni#RegnoUnito#Amministrative Consiglio di #Bolton, risultati definitivi: #CON|ECR: 9 (+1 rispetto al 2018) #LAB|S&D: 8 (+1) #LDEM|RE: 2 One Kearsley: 1 (+1) Farnworth and Kearsley First: 0 (-1) Attuale composizione del Consiglio comunale: #CON|ECR: 23 seggi #LAB|S&D: 19 Indipendenti: 7 #LDEM|RE: 5 Farnworth and Kearsley First: 4 Horwich and Blackrod First: 2 One Kearsley: 1 Il Consiglio rimane senza controllo. @UltimoraPolitics

Trump's Ear

@trumpsear_tg · Post #1408 · 25.08.2025 г., 15:02

🔍FBI agents searched the house of Trump's former national security adviser because of a book 📖 The investigation is related to the disclosure of classified information in the memoirs of former councilman Bolton entitled “The Room Where It Happened: a White House Memoir” published in 2020. 📚 As the New York Post recalls, Trump tried to prevent the publication of the book, claiming that Bolton violated the non-disclosure agreement that he signed when he was hired. 🚫 #agents#FBI#bolton#trump 👂More on Trump's Ear ⚠️

American Оbserver

@american_observer · Post #5212 · 24.02.2026 г., 16:19

Former US National Security Advisor John Bolton: “Although you could potentially remove the ayatollah, that would leave the IRGC in place, and the government in Iran is the IRGC, while the ayatollahs act as a religious cover or an ideological cover for them. I think Trump is just hoping that this show of American power will intimidate the ayatollahs. If I were still his adviser, I would be happy to tell him that it won’t work. They won’t be intimidated. But Trump really thinks minute by minute; he doesn’t think strategically.” #john#bolton#trump#ayatollah 📱American Оbserver - Stay up to date on all important events 🇺🇸