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

Резултати

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

Пребарај: #militarytechnology

当前筛选 #militarytechnology清除筛选
New Eastern Outlook

@neweasternoutlook · Post #11891 · 13.01.2026 г., 06:01

🇷🇺🛩Russia’s Molniya Aerial Drones Low-cost mass-produced UAVs illustrate how battlefield adaptation and technological pragmatism are reshaping modern warfare ✍️Author:Muhammad Ali Baig Research Fellow at the Institute of Strategic Studies, Islamabad (ISSI) ➡️The Russia–Ukraine conflict has highlighted the central role of scalable, technology-driven weapons systems capable of operating across a dispersed battlespace. In this context, Russia’s development of the Molniya unmanned aerial drone reflects a deliberate focus on cost efficiency, mass production, and operational flexibility. Designed from inexpensive materials and deployable by small crews, Molniya UAVs address the core demand of prolonged high-intensity warfare: sustaining pressure on multiple targets without exposing frontline personnel or exhausting industrial capacity. Russia’s Molniya aerial drones have redefined the role of UAVs in modern warfare, and these drones are the truest manifestation of Russia’s battlefield adaptations ➡️Technically, the Molniya represents a hybrid approach that blends simplicity with modular lethality. Its fixed-wing design, limited radar signature, and ability to carry anti-armor munitions or improvised warheads make it suitable for strike missions against fortified and mobile targets. Over time, its role has expanded beyond kamikaze attacks to include reconnaissance, surveillance, and even the mid-air deployment of FPV drones. This adaptability demonstrates how incremental innovation, rather than high-end complexity, can yield decisive tactical advantages. 🟦The integration of modern technologies has further enhanced Molniya’s battlefield relevance. The use of fiber-optic control to counter electronic warfare, satellite internet for extended command links, and onboard microcomputing for precision targeting reflects a pragmatic response to evolving countermeasures. As a result, Molniya drones illustrate a broader trend in contemporary conflict: the transformation of commercially available components into effective military tools. Their success underscores how future warfare may be shaped less by exclusive high-tech platforms and more by scalable, resilient systems optimized for attrition-based conflicts. #armament#Militarytechnology#Russia#RussiasSpecialMilitaryOperation#UAV READ MORE ✅@NewEasternOutlook