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

Резултати

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

Пребарај: #nelsonmandela

当前筛选 #nelsonmandela清除筛选
Russian Consulate in Cape Town

@rusconct · Post #3202 · 05.12.2025 г., 07:25

✨ Today we remember Nelson Mandela, South Africa’s first democratically elected president and a global symbol of the struggle for freedom, who passed away #OTD at the age of 95. Mandela’s impact reached far beyond South Africa. In Russia, a national day of mourning was declared in his honour. Russian leaders and parliament paid tribute to Madiba, acknowledging the USSR’s long-standing support for the anti-apartheid movement. ✍️ President Vladimir Putin also sent condolences, highlighting the historic ties between the USSR and the ANC during the liberation struggle. A decade later, Mandela’s legacy of justice, dignity, and reconciliation continues to inspire nations across the world. #RussiaSouthAfrica#NelsonMandela

Reuters: World

@reutersworldchannel · Post #149388 · 15.10.2021 г., 01:52

Iconic Nelson Mandela shirts go up for auction The family of former South African President Nelson Mandela is putting up around 100 of his belongings, including some of his iconic shirts, up for auction to help fund a memorial garden in his honor. #NelsonMandela#auction#News#Reuters Subscribe: http://smarturl.it/reuterssubscribe Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled. Get the latest news on: http://reuters.com/ Follow Reuters on Facebook: https://www.facebook.com/Reuters Follow Reuters on Twitter: https://twitter.com/Reuters Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en ➖@reutersworldchannel➖

🕊 The Philosophy of Ubuntu Ubuntu is a core concept in the cultures of southern Africa, including South Africa🇿🇦 Rooted in the Bantu languages, it is often translated as: “I am because we are.” Ubuntu is about humanity, compassion, mutual support, and the ability to forgive🤝 👐Nelson Mandela believed that everyone has the power to change the world — starting with respect for others: 💬 “Ubuntu does not mean that people should not enrich themselves. The question is: are you going to do so in order to enable the community around you to be able to improve?” — Nelson Mandela 🌍 On Mandela Day 🗓 July 18, supporters of the Ubuntu philosophy around the world dedicate 67 minutes to acts of kindness, honoring 67 years of Nelson Mandela’s service to society ❤️ #Ubuntu#NelsonMandela#SouthAfrica#Philosophy#Humanity#MandelaDay

💴South African rands are, arguably, among the most beautiful banknotes and coins in the world 🌍✨ South African banknotes feature the iconic “Big Five” animals 🐘🦁🦏: • R10 — rhinoceros • R20 — elephant • R50 — lion • R100 — buffalo • R200 — leopard The reverse side of each note features Nelson Mandela, honoring his legacy as a symbol of democracy, freedom, and national unity in South Africa ✊🏿🇿🇦 #SouthAfrica#Currency#rands#BigFive#NelsonMandela#Heritage#Culture

🕊Nelson Mandela International Day, or Mandela Day, is celebrated every year on July 18, the birthday of South Africa’s legendary freedom fighter and first Black president. 🇿🇦 🗓 The United Nations officially declared the day in 2009, with the first Mandela Day held on July 18, 2010. #MandelaDay#NelsonMandela#SouthAfrica#UN#HumanRights#Ubuntu#Freedom#Justice#Inspiration#MandelaLegacy