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 слични објави

Пребарај: #russiandrones

当前筛选 #russiandrones清除筛选
Red Nile

@rednile12 · Post #10879 · 25.01.2026 г., 19:21

🔺Continuation from above @rednile12 🔍 Why this confirmation matters The unveiling is corroborated by multiple defence-focused outlets with photos and videos from the expo, including: 🔗Defence Blog (breaking report): 🔗Defence Security Asia (in-depth analysis): ▪️ Additional confirmation came from UNITED24 Media and Ethiopia’s Institute of Foreign Affairs (IFA), reinforcing that this is consistent, cross-verified reporting, not media hype. ▪️Variants on display suggest ISR-focused configurations, while reporting confirms strike-capable Orion-E versions are part of the acquisition — aligning with the platform’s dual-role MALE design. ▪️While no formal press release has been issued by Addis Ababa or Rosoboronexport (standard practice for sensitive arms deals), the public exhibition itself functions as de facto confirmation. 🛩️ Aviation Expo 2026 — key context 📍Location: Bishoftu Air Force Headquarters 🎖️Occasion: 90th anniversary of the Ethiopian Air Force — the Black Lion 📅Dates: January 23–27, 2026 🌍Theme:“Flying Forward, Building a Shared Future” 🛰️ What Ethiopia is actually acquiring According to Defence Security Asia: ▪️The Orion-E is a medium-altitude, long-endurance (MALE) UAV capable of 24+ hours endurance ▪️Payload capacity of up to 250 kg, supporting electro-optical/infrared sensors and precision-guided munitions ▪️Operational altitude of roughly 7,500 meters, designed to remain above most MANPADS threats ▪️Optimised for persistent ISR and precision strike, particularly in large, rugged, infrastructure-poor environments like the Horn of Africa 💸 The deal is widely assessed to be worth USD 300–500 million, likely covering: ▪️Multiple airframes ▪️Ground control stations ▪️Training and operational support ▪️Weapons integration and sustainment 🌍 Strategic implications The Orion-E unveiling marks: A decisive leap in Ethiopian airpower modernisation ▪️ A clear shift toward sovereignty-centric, non-Western defence partnerships, especially after Western arms restrictions during the Tigray conflict ▪️Russia’s first real breakthrough in exporting MALE UAVs, validating long-stated claims by Rosoboronexport chief Alexander Mikheev that multiple Orion contracts had been signed 🔹 Regionally, Ethiopia’s drone modernisation directly affects: ▪️Horn of Africa security dynamics ▪️The Red Sea and Bab al-Mandab corridor ▪️Deterrence, escalation control, and power projection through persistent unmanned dominance 📌 Bottom line This is not speculation, not propaganda, and not unverified chatter. Ethiopia has now visibly entered the MALE-class drone club, becoming the first foreign operator of Russia’s Orion-E and a pace-setter in Africa’s next phase of aerial warfare. The skies over Africa are changing — and Ethiopia is choosing to shape that future, not react to it. — RedNile Media🌊🧭 📡@rednile12 Geopolitics | Multipolarity | Sovereignty | Strategic Reality #Ethiopia#OrionE#RussianDrones#AfricanAirpower#DroneWarfare#EthiopianAirForce#HornOfAfrica#RedSea#MilitaryModernization#Geopolitics