@ElRincon_delConsejero · Post #5542 · 10.04.2026 г., 06:20
#consejodeldía #NelsonMandela
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #22 · 19 јан.
Заметка начинающим, которые часто сталкиваются с подобной непоняткой. Ситуация следующая, есть список файлов: names = [ 'image.bmp', 'second.txt.bkp', 'data.db', '.config.cfg', 'file.ext.bkp' ] И мы хотим убрать у них окончание ".bkp". Не знаю зачем, пример довольно надуманный) Но суть он показывает, а это главное. Те, кто еще не очень знаком с библиотекой os.path или pathlib, вероятно решат обработать имена как строки. И тут вполне подойдет метод строки strip(). Что делает этот метод? Он отрезает указанные символы по обеим сторонам строки. Если ничего не указать, то убирает невидимые символы (пробелы, табуляции и переносы строк). В нашем случае будет выглядеть вот так: >>> name.strip('.bkp') То есть просим удалить строку '.bkp' по краям имени файла, если таковая есть. Можно применить аналогичный метод rstrip(), чтобы отрезать только справа, но для этого примера используем обычный. >>> for name in names: >>> print(name.strip('.bkp')) image.bm second.txt data.d config.cfg file.ext Хм, что-то не то с нашими именами! Что случилось??? Видим нежелательное переименование в именах, где и близко не было указанной строки '.bkp' А дело всё в том, что данный метод ищет не указанную строку, а указанные символы, и не важно в каком порядке. Для метода strip() строка '.bkp' это не паттерн для поискаа список символов. Потому он отрезал симовол 'p' от '.bmp' и удалил точку из файла '.config.cfg'. Как тогда правильно заменить именно паттерн? Для начинающего можно посоветовать метод строки replace(), который как раз использует для замены указанную строку целиком. В нашем примере заменим её на пустую строку. >>> for name in names: >>> print(name.replace('.bkp', '')) image.bmp second.txt data.db .config.cfg file.ext Уже лучше, но помните, это лишь пример про strip(). Для работы с именами файлов есть способы и более "правильные", дающие однозначно верный результат. Я взял файлы только в качестве примера. Даже replase() тут может сделать не то что ожидаем. Просто впредь будьте внимательны с этим strip(). #basic
Hashtags
Пребарај: #nelsonmandela
@ElRincon_delConsejero · Post #5542 · 10.04.2026 г., 06:20
#consejodeldía #NelsonMandela
Hashtags
@ElRincon_delConsejero · Post #5172 · 25.08.2025 г., 06:05
#consejodeldía #NelsonMandela
Hashtags
@ElRincon_delConsejero · Post #4876 · 19.03.2025 г., 06:38
#consejodeldía #NelsonMandela
Hashtags
@ElRincon_delConsejero · Post #4748 · 14.12.2024 г., 06:44
#pensamientodeldia #NelsonMandela
Hashtags
@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
@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➖
@FFC_official_channel · Post #32 · 24.04.2024 г., 21:23
Mandla Mandela, member of the National Assembly of South Africa and Nelson Mandela’s grandson, reacts to the news of the Freedom Flotilla’s boarding date announcement. #mandlamandela#nelsonmandela#freedomflotilla#breakthesiege
@sarconsulurals · Post #2930 · 23.12.2025 г., 02:47
🕊 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
@sarconsulurals · Post #3072 · 26.01.2026 г., 02:47
💴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
@sarconsulurals · Post #2339 · 18.07.2025 г., 05:17
🕊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