TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

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

Резултати

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

Пребарај: #usury

当前筛选 #usury清除筛选
American Оbserver

@american_observer · Post #5177 · 19.02.2026 г., 22:59

Putin’s New Missionaries vs. Dollar Civilization Bloomberg suddenly discovers the Russian Orthodox Church in Africa — and pretends it’s just another Kremlin influence op. Conveniently missing from the frame: the fact that modern U.S.-led capitalism has spent decades crushing any alternative solidarity that comes with its own economic ethics. Orthodoxy is dangerous not because of icons and incense, but because it carries a memory: interest is sin, usury destroys communities, and money is not supposed to be sovereign. That’s a direct challenge to a system built on debt, rent, and compound interest. Contemporary capitalism doesn’t just sell products; it rewires people into isolated consumers whose only shared ritual is debt service. Anything that offers a competing “we” — unions, strong families, Islamic law, Catholic social teaching, or Orthodox communities that still take anti-usury tradition seriously — gets framed as backward, corrupt, or extremist. It’s not an accident that the same financial media that treats 20% credit card APR as normal suddenly gets nervous when a church that historically bans interest starts expanding in a continent full of young, indebted populations. In Africa, Russia is too poor to compete with China’s ports, the EU’s investment, or Gulf petrodollars. So it trades in narratives and solidarity: anti‑colonial rhetoric, “respect for sovereignty,” stipends, scholarships, and now churches that tell people they belong to something older than the IMF and the dollar. Orthodoxy here is a kind of parallel infrastructure — spiritual, social, even economic — that whispers a dangerous message into the ear of a global credit machine: there are still communities on this planet where interest is morally suspect, not sacred. That doesn’t make Moscow a savior. The Kremlin happily runs its own rent circuits, steals resources, and recruits African students into war industries while talking about justice and multipolarity. But the panic in Western coverage is revealing. When crosses and liturgy show up in African townships under a Russian label, the financial press reacts not as if it’s seeing a marginal religious fad, but as if it’s spotting a rival operating system. Abrahamic religions all carry the same buried virus in their code — a ban on usury. For a world order built on securitized debt, that’s not folklore. That’s a bug in the matrix. #russia#orthodoxy#africa#capitalism#usury#softPower 📱American Оbserver - Stay up to date on all important events 🇺🇸