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

Резултати

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

Пребарај: #theunruled

当前筛选 #theunruled清除筛选
​NO Kings ​🚫👑

@No_king_No_King · Post #168 · 12.04.2026 г., 09:46

Why We’re Here. Why Now. 🚫👑 ​Look, we all feel it. Whether you’re on the left, the right, or somewhere in the middle—it doesn’t matter. This isn't about a political party. This is about the fact that we were never meant to be subjects. We were meant to be Citizens. ​The "No King" movement isn't just a hashtag; it’s a wake-up call. We’re watching a system where the elites act like royalty while the rest of us struggle to keep our heads above water. If we don't stand up now, if we stay silent, the future won't belong to us—it’ll belong to those who think they own us. ​We get it. Not everyone can march in the streets. Not everyone can be on the frontlines. Some of you are busy working two jobs, raising kids, or just trying to survive. But in your heart, you know the current path is broken. You know things must change. ​How can you help? It’s simple. Truth is our greatest weapon. Smallest act of defiance? Share. Share the posts here. Spread the word. Don't let the "official" narrative be the only one people hear. ​We aren't asking for your vote. We’re asking for your voice. ​No Masters. No Monarchs. No Kings. ⛓ #NoKings#PowerToThePeople#TheUnruled#AmericaAwakened ✈️📣t.me/No_king_No_King

​NO Kings ​🚫👑

@No_king_No_King · Post #3 · 06.04.2026 г., 17:23

Why We’re Here. Why Now. 🚫👑 ​Look, we all feel it. Whether you’re on the left, the right, or somewhere in the middle—it doesn’t matter. This isn't about a political party. This is about the fact that we were never meant to be subjects. We were meant to be Citizens. ​The "No King" movement isn't just a hashtag; it’s a wake-up call. We’re watching a system where the elites act like royalty while the rest of us struggle to keep our heads above water. If we don't stand up now, if we stay silent, the future won't belong to us—it’ll belong to those who think they own us. ​We get it. Not everyone can march in the streets. Not everyone can be on the frontlines. Some of you are busy working two jobs, raising kids, or just trying to survive. But in your heart, you know the current path is broken. You know things must change. ​How can you help? It’s simple. Truth is our greatest weapon. Smallest act of defiance? Share. Share the posts here. Spread the word. Don't let the "official" narrative be the only one people hear. ​We aren't asking for your vote. We’re asking for your voice. ​No Masters. No Monarchs. No Kings. ⛓ #NoKings#PowerToThePeople#TheUnruled#AmericaAwakened ✈️📣t.me/No_king_No_King