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

Пребарај: #herlegacy

当前筛选 #herlegacy清除筛选
Bloom Org

@bloomorg_uz · Post #45 · 31.05.2025 г., 16:56

#LetHerBloom#HerLegacy 🌸 Today, we are coming back with our rubric “Her Legacy”, where we dive into lives of women who changed not only theirs, but millions of other women’s lives. Bloom will tell you who Malala is, her global impact, her achievements, and why she inspires us. 🪄She is the one who taught us that one voice can change revolutions. Remember: ✨One spark can cause fire that millions of people cannot stop. Be that spark! 💜 Let’s change the world together! Let’s get the strength and change OUR lives. And after all, Let Her Bloom! 🚀Telegram | 📷Instagram

Bloom Org

@bloomorg_uz · Post #10 · 25.04.2025 г., 18:04

#LetHerBloom#BloomTogether#MentalHealthAwareness#AbusePrevention#HerLegacy 🌸Introducing Bloom’s New Rubric Series🌸 We’re launching a fresh series of posts to raise awareness, educate, and create conversations that matter. Here’s what you’ll see on our page: ✨ Abuse 101 – A breakdown of the different types of abuse. 🚩⏺ Red & Green Flags – What’s healthy vs. what’s harmful in relationships. 🧠 Mental Health Impact – The emotional cost of abuse. 🤝 If You Think Someone’s Being Abused – What to do and how to help. 💐 Her Legacy – Stories of powerful women who changed the world. 🌿 Healthy Boundaries – Why they matter and how to set them. 🎬 Feminism in Media – Representation, reality, and rewriting the narrative. Stay tuned, stay aware, and let’s keep growing together 🌱💜 🚀Telegram📷Instagram