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

Резултати

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

Пребарај: #alexanderdugin

当前筛选 #alexanderdugin清除筛选
GlobUs en français

@GlobUsFr · Post #6 · 11.09.2025 г., 13:47

Une discussion sur la géopolitique du 21e siècle a été organisé avec la participation d'éminents experts et analystes internationaux Le 15 août, une discussion sur principaux aspects de la géopolitique moderne a eu lieu, intitulée: " Les tendances Actuelles dans la nouvelle configuration géopolitique du 21e siècle." L’événement est devenu un jalon intellectuel important, réunissant des experts à l`échelle mondiale. Cet initiative scientifique et analytique internationale a été organisée avec la participation de grands centres de la réflexion stratégique de l'Amérique du Sud, de l'Eurasie et de l'Europe. Une liste non-exaustive d’organisateurs a inclus la plate-forme analytique "Proyecto Patria", le centre de recherche Crisolist (Pérou), le L club d’experts GlobUs (Russie), la direction Régionale du Centre pour les Études Internationales (PROJET) au Nicaragua, l'Institut espagnol de la Géopolitique et l’entreprise internationale de la production internationale ASIA TV (Argentine), tous spécialisés dans l'analyse géopolitique et le contenu des médias à l’échelle mondiale. L'événement a été particulièrement significative grâce à la participation d'éminents experts des relations internationales et de l'analyse stratégique, y compris le Professeur Alexander Dugin, M. Norberto Emmerich (Argentine), M. Enrique D'Assedo (Espagne), connu pour ses recherches la géopolitiques et idéologies, le Dr Eduardo Hernando (Pérou), Maître Manuel Espinosa (Nicaragua), ainsi que le Dr Victor Pimentel Roque et autres сhercheurs. Cet événement est devenu non seulement une plate-forme pour l'échange de connaissances, mais aussi une étape importante dans la formation d'un multipolaire dialogue intellectuel susceptible d'affecter la compréhension des processus au sein d’une nouvelle réalité géopolitique. #AlexanderDugin#MultipolarWorld#GlobalProcesses#InternationalRelations

Paideuma.TV Internacional

@paideumatvinternational · Post #226 · 04.11.2025 г., 10:06

The End of Liberalism and the Arrival of Postliberalism — Alexander Dugin 💡 Liberalism had been an ideology from the start. It was not as dogmatic as Marxism, but was no less philosophical, graceful, and refined. 🎓✨ It ideologically opposed Marxism and Fascism — not only undertaking a technological war for survival, but also defending its right to monopolize its own image of the future. ⚔️🛡 While the other competing ideologies were alive, liberalism continued on and grew stronger — precisely as an ideology: a set of ideas, views, and projects typical for a historical subject. 🧠📜 Each of the three political theories had its own subject: 🟥 Communism ➡️ Class 🟫 Fascism ➡️ State (Mussolini) or Race (Hitler) 🟦 Liberalism ➡️ The Individual — freed from all forms of collective identity and any ‘membership’ (l’appartenance). 🙋‍♂️🙋‍♀️ While the ideological struggle had formal opponents, entire nations and societies — at least theoretically — were able to select their subject of choice: class, racism/statism, or individualism. 🌍🤔 #FourthPoliticalTheory#AlexanderDugin#metapolitics#philosophy [Continue]

Paideuma.TV Internacional

@paideumatvinternational · Post #109 · 13.04.2023 г., 06:18

Ethnosociology lecture 1. Introduction The first section describes the major sources and schools related to ethnosociology (sociology, anthropology, ethnology, cultural, social and structural anthropology, etc.), both foreign and Russian. The basic terminological apparatus is outlined. #Ethnosociology#sociology#anthropology#AlexanderDugin