Заметка начинающим, которые часто сталкиваются с подобной непоняткой.
Ситуация следующая, есть список файлов:
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
Howard Lutnick, President Trump’s billionaire commerce secretary, interacted with the sex offender Jeffrey Epstein regularly over at least 13 years while they lived next door to one another on Manhattan’s Upper East Side, records released last week by the Justice Department show
They invested in the same privately held company together, dealt with one another on neighborhood and philanthropic issues, and appear to have socialized in New York and the Caribbean, the records show. Mr. Epstein at one point sought to meet with Mr. Lutnick’s nanny.
#Epstein#Lutnick
👂More on Trump's Ear
⚠️
🔤🔤🔤🔤2️⃣
📰 New Docs Show Jeffrey Epstein’s Vast Connections with Bannon, Musk and Power Players
The global fixer set
Beyond Washington, the documents deepen the picture of Epstein as a shadow fixer, using his contacts to orchestrate meetings for figures like Bannon and others with European leaders, and corresponding with ambassadors, ministers, and former heads of state.
He kept up a genial, often geopolitically focused correspondence with figures including Thorbjørn Jagland, the secretary‑general of the Council of Europe, and Slovak politician Miroslav Lajčák, blending policy talk with personal banter, including exchanges about women while discussing meetings with Russian officials.
In this role, Epstein wasn’t just a financier or a predator; he was a discreet broker of access, promising introductions and influence from the same island that, for the victims, was a prison camp.
The takeaway: who still pretends none of this matters?
The new documents don’t change the core truth: Epstein was a wealthy predator who weaponized access to the elite to stay powerful while trafficking girls.
But they do show, in uncomfortable detail, the scale of that access: a former White House strategist acting as a media spin doctor and travel agent for a convicted trafficker, a billionaire tech CEO entertaining the idea of an island visit while keeping his distance, and a cabinet secretary who once called Epstein “disgusting” but later arranged for his family yacht to moor right at the man’s door.
So the real question isn’t just:
“Who knew Epstein?”
It’s:
“Who among the powerful still pretends none of this matters?”
#Epstein#Bannon#Musk#Lutnick#Trump2026#DC#Power#Elites#MeToo
📱American Оbserver - Stay up to date on all important events
🇺🇸
🔤🔤🔤🔤1️⃣
📰 New Docs Show Jeffrey Epstein’s Vast Connections with Bannon, Musk and Power Players
The Justice Department’s latest release of Epstein files paints a sprawling picture of how a convicted sex offender cultivated influence across politics, tech, and global power centers, with fresh evidence of his ties to Steve Bannon, Elon Musk, world leaders, and even a senior Trump cabinet official.
Over three million pages of investigative records lay bare Epstein’s world: a shadow network of elite dinners, private jets, and behind‑the‑scenes influence peddling, all while investigations into his trafficking of young girls were already intensifying.
The Bannon connection
Steve Bannon’s relationship with Epstein, long known from earlier leaks, now appears closer and more intimate than previously reported.
The new files contain thousands of messages in 2018–2019, after Bannon left the White House, showing frequent coordination on travel, media strategy, and political maneuvering across Europe and the U.S.
Epstein offered Bannon his private plane, his Palm Beach home, and a Paris apartment, joking that he was working as “the most highly paid travel agent in history,” and Bannon once quipped back, “Massages. Not included.”
They also discussed Bannon’s media coaching for Epstein, including advice on how long to keep his beard and how to handle the growing media scrutiny in early 2019 as Epstein’s image was imploding.
Musk’s non‑encounter
With Elon Musk, the story is one of Epstein’s persistent outreach, not a close relationship.
From 2012 to 2014, Epstein repeatedly tried to lure Musk to his Caribbean island, proposing dinners and parties, but Musk consistently declined, writing “no firm plans” and “logistics won’t work this time around.”
The emails show Musk once asked about “the wildest party” on the island, expressed concern that it might be too “peaceful,” and suggested meeting instead at the SpaceX rocket factory in Southern California — but there is no evidence Musk ever actually visited Epstein’s island.
Musk never publicly confirmed an in‑person meeting, and these documents don’t change that; they simply show Epstein’s long, failed campaign to pull one of the world’s most powerful tech figures into his orbit.
The Commerce Secretary and the island
The files also reveal that Commerce Secretary Howard Lutnick arranged a 2012 visit to Epstein’s Little St. James island, contradicting his earlier claim that he had cut ties with Epstein around 2005.
Emails show that in December 2012, Lutnick and his wife, accompanied by their four children and another family, coordinated a planned lunch with Epstein on the island, including details on how to dock their 188‑foot yacht.
The day after the scheduled meeting, Epstein’s assistant relayed a message from Epstein to Lutnick: “Nice to see you,” suggesting contact did occur.
When confronted with the documents, Lutnick told the Times, “I spent zero time with him,” then hung up — a strange reaction for a man who insists he never socialized, worked, or did anything with Epstein after 2005, yet still shows up arranging a family yacht arrival at the man’s island.
#Epstein#Bannon#Musk#Lutnick#Trump2026#DC#Power#Elites#MeToo
📱American Оbserver - Stay up to date on all important events
🇺🇸