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

Пребарај: #amitytashkent

当前筛选 #amitytashkent清除筛选
Amity University Tashkent

@amityuniversitytashkent · Post #5138 · 06.11.2025 г., 15:10

#photoreport 😃✨Graduation Vibes at Amity University Tashkent! ✨🎓 On November 6, we proudly celebrated the Graduation Ceremony of the Class of 2025 — a day full of joy, pride, and unforgettable memories! 😍 🎶The event kicked off with the National Anthem of Uzbekistan, setting a proud tone for the celebration. Inspiring speeches followed from Mr. Rustam Karimjonov, Deputy Minister of Digital Technologies of Uzbekistan, and Mr. Amol Chauhan, Senior Vice President of Amity University. 👏 They applauded the dedication and achievements of our graduates and encouraged them to shape the future with passion, creativity, and purpose. 💫 #AmityTashkent#Graduation2025#ProudMoment#AmityFamily 🇺🇿O'zbek tilida 😜Telegram😂Facebook😀Instagram😅Youtube😃Linkedin

Amity University Tashkent

@amityuniversitytashkent · Post #5071 · 25.10.2025 г., 04:21

😀 Heartfelt Congratulations to Dr. Ashok K. Chauhan 🌟 Today, the team of Amity University Tashkent proudly extends its warmest congratulations to Dr. Ashok K. Chauhan, the visionary Founder President of Amity Education Group. Your dedication, wisdom, and lifelong mission to transform education have built a legacy that continues to inspire millions of students across the world. Under your exceptional leadership, Amity has become a global symbol of knowledge, innovation, and human values. Your belief that “Each student must be a success story” resonates deeply with our purpose here in Tashkent and guides us to nurture future leaders with passion and integrity. 💫 We wish you endless energy, good health, and continued success in your noble journey of shaping minds and empowering generations. With deepest respect and admiration, Team of Amity University Tashkent 🇺🇿 #AmityUniversity#AmityTashkent#DrAshokKChauhan#FounderPresident#AmityEducationGroup#GlobalEducation#Leadership#SuccessStory#AmitySpirit#ProudToBeAmity 😜Telegram😂Facebook😀Instagram😅Youtube😃Linkedin