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

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #65 · 8 апр.

Небольшой трик с регулярными выражениями который редко вижу в чужом коде. Допустим, вам нужно распарсить простой текст и вытащить оттуда пары имя+телефон. Вернуть всё это надо в виде списка словарей. Возьмем очень простой пример текста. >>> text = ''' >>> Alex:8999123456 >>> Mike:+799987654 >>> Oleg:+344456789 >>> ''' Соответственно, для выделения нужных элементов будем использовать группы. Получится такой паттерн: (\w+):([\d+]+) Как мы будем формировать словарь из найденных групп? >>> import re >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append({ >>> "name": match.group(1), >>> "phone": match.group(2) >>> }) >>> print(results) [{'name': 'Alex', 'phone': '8999123456'}, ...] Можно немного сократить запись используя zip >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append(dict(zip(['name', 'phone'], match.groups()))) Но есть способ лучше! Это именованные группы в regex. Можно в паттерне указать имя группы и результат сразу забрать в виде словаря. >>> for match in re.finditer(r"(?P<name>\w+):(?P<phone>[\d+]+)", text): >>> results.append(match.groupdict()) То есть всё что я сделал, это добавил в начале группы (внутри сбокочек) такую запись: (?P<group-name>...) Теперь найденная группа имеет имя и можно обратиться к ней как к элементу списка >>> name = match['name'] Либо забрать сразу весь словарь методом groupdict() >>> match.groupdict() #tricks#regex

Резултати

Пронајдени 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