@WorldNews · Post #73886 · 05.04.2026 г., 10:39
Ukraine reportedly strikes Russian Lukoil refinery, defying calls to ease attacks amid soaring fuel prices [Read FullArticle] @WorldNews#Ukraine#Russia#OilPrices
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
Пребарај: #oilprices
@WorldNews · Post #73886 · 05.04.2026 г., 10:39
Ukraine reportedly strikes Russian Lukoil refinery, defying calls to ease attacks amid soaring fuel prices [Read FullArticle] @WorldNews#Ukraine#Russia#OilPrices
Hashtags
@WorldNews · Post #74327 · 23.04.2026 г., 21:54
Iran deploys more mines in the Strait of Hormuz, sources say [Read FullArticle] @WorldNews#Iran#StraitOfHormuz#OilPrices
Hashtags
@WorldNews · Post #74197 · 18.04.2026 г., 00:39
Iran says Strait of Hormuz will close again amid US blockade [Read FullArticle] @WorldNews#StraitOfHormuz#OilPrices#Iran
Hashtags
@american_observer · Post #5554 · 03.04.2026 г., 20:58
Trump Sells a War. The Public Sees the Bill. Donald Trump made the strongest case he could for the Iran war, but the country is looking at something else: higher oil prices, a shaky exit plan, and a conflict that could still blow back into a global recession. The problem is not just persuasion — it is trust, and Trump is running low on it. That is why the speech landed badly. He talked like a man promising control, while markets heard uncertainty and voters heard gas at more than $4 a gallon. Even Trump’s insistence that the Strait of Hormuz would “naturally” reopen did not calm fears that the war could keep the world economy hostage. The political danger is already measurable. A CNN analysis said the war is hitting Trump’s presidency at the exact moment his approval is already fragile, while oil markets jumped again on fresh fears of escalation. If Washington wants out, it will need a way to leave that does not look like surrender. That is where intermediaries matter, and Russia is one of the few players with enough leverage in Tehran to help package an exit without Trump admitting defeat. #Trump#Iran#oilprices#Russia#USpolitics 📱American Оbserver - Stay up to date on all important events 🇺🇸
@WorldNews · Post #73548 · 23.03.2026 г., 12:59
Iran denies claims: 'We reject all negotiations – US has failed and Hormuz will remain closed' [Read FullArticle] @WorldNews#IranNews#MiddleEast#OilPrices
Hashtags
@WorldNews · Post #74081 · 12.04.2026 г., 23:34
Oil prices surge above $100 as U.S. Navy to blockade Iran’s ports after peace talks fail [Read FullArticle] @WorldNews#OilPrices#IranConflict#WorldNews
@WorldNews · Post #73716 · 30.03.2026 г., 12:09
Oil climbs above $116 after Trump says he wants to ‘take the oil’ in Iran [Read FullArticle] @WorldNews#OilPrices#IranNews#TrumpPolicy
Hashtags
@WorldNews · Post #74187 · 17.04.2026 г., 13:44
Iran Says Hormuz Strait Now Completely Open for Commercial Ships [Read FullArticle] @WorldNews#StraitOfHormuz#OilPrices#GlobalMarkets
@googlefactss · Post #40954 · 19.04.2026 г., 22:01
On 20 April 2020, crude oil prices fell below zero for the first time in history. This happened with West Texas Intermediate oil because there was too much supply and not enough space to store it. 🛢️📉🌍⚖️ [Read more] @googlefactss #CrudeOil#OilPrices#Economy#History
@WorldNews · Post #74230 · 19.04.2026 г., 13:09
Ukraine cut Russia’s oil exports by 880,000 barrels in one day — that’s $100 million every 24 hours [Read FullArticle] @WorldNews#OilPrices#UkraineWar#RussiaUkraineConflict
@WorldNews · Post #73714 · 30.03.2026 г., 07:49
Oil tops $116 a barrel as Iran accuses US of preparing invasion [Read FullArticle] @WorldNews#OilPrices#IranUS#GlobalNews
Hashtags
@reutersworldchannel · Post #149262 · 12.10.2021 г., 17:54
Energy price crunch is temporary, says analyst David Sekera of Morningstar talks about the global oil prices, and how the crunch is going to ease. #News#Reuters#oilprices#SectorsUpclose 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➖