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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #241 · 5 мај

Можно ли в Python создавать бинарные файлы? Конечно можно. Для этого в Python есть следующие инструменты: ▫️ тип данных bytes и bytearray ▫️ открытие файла в режиме wb (write binary) или rb (read binary) ▫️ модуль struct Про модуль struct поговорим в первую очередь. Файл в формате JSON или Yaml внутри себя содержит разметку данных. Всегда можно определить где список начался а где закончился. Где записана строка а где словарь. То есть формат записи данных содержит в себе элементы разметки данных. В binary-файле данные не имеют визуальной разметки. Это просто байты, записанные один за другим. Правила записи и чтения находятся вне файла. Модуль struct как раз и помогает с организацией данных в таком файле с помощью определения форматов записи для разных частей файла. Модуль struct преобразует Python-объекты в массив байт, готовый к записи в файл и имеющий определённый вид. Для этого всегда следует указывать формат преобразования (или, как оно здесь называется - запаковки). Формат нужен для того, чтобы выделить достаточное количество байт для записи конкретного типа объекта. В последствии с помощью того же формата будет производиться чтение. При этом следует помнить что мы говорим о типах языка С а не Python. Именно формат определяет, что записано в конкретном месте файла, число, строка или что-то еще. Вот какие токены формата у нас есть. Помимо этого, первым символом можно указать порядок байтов. На разных системах одни и те же типы данных могут записываться по-разному, поэтому желательно указать конкретный способ из доступных. Если этого не сделать, то используется символ '@', то есть нативный для текущей системы. В строке формата мы пишем в каком порядке и какие типы собираемся преобразовать в байты. Запакуем в байты простое число, токен "i". >>> import struct >>> struct.pack('=i', 10) b'\n\x00\x00\x00' Теперь несколько float, при этом нужно передавать элементы не массивом а последовательностью аргументов. >>> struct.pack('=fff', 1.0, 2.5, 4.1) b'\x00\x00\x80?\x00\x00 @33\x83@' Вместо нескольких токенов можно просто указать нужное количество элементов перед одним токеном, результат будет тот же. >>> struct.pack('=3f', 1.0, 2.5, 4.1) b'\x00\x00\x80?\x00\x00 @33\x83@' Теперь запакуем разные типы >>> data = struct.pack('=fiQ', 1.0, 4, 100500) я запаковал типы float, int и unsigned long long (очень большой int, на 8 байт) b'\x00\x00\x80?\x04\x00\x00...' Распаковка происходит аналогично, но нужно указать тот же формат, который использовался при запаковке. Результат возвращается всегда в виде кортежа. >>> struct.unpack('=fiQ', data) (1.0, 4, 100500) Как видите, ничего страшного! #lib#basic

Hashtags

Резултати

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

Пребарај: #meron

当前筛选 #meron清除筛选
American Оbserver

@american_observer · Post #5402 · 17.03.2026 г., 16:05

The ‘Eyes of the State’ Under Fire Israel’s and America’s “eyes” in the region are getting scratched out one by one — slowly, cheaply, and in full view of every OSINT nerd with a Planet Labs subscription. Iran and Hezbollah aren’t just overwhelming interceptors; they’re dismantling the radar skeleton that tells those interceptors where to look. ​ Hezbollah has been methodically working over Israel’s Meron air-control base — the “eyes of the state” — since January 2024: first with a 62‑round mix of Katyushas and Kornet ATGMs that visibly smashed at least two radar domes, then with follow‑up missile strikes and now attack drones. Iron Dome is built to kill ballistic arcs, not straight‑flying anti‑tank missiles guided off Google Earth, and Hezbollah leans into that gap like it’s reading the brochure. Official line: capabilities “unharmed,” backup systems “working”; unofficial reality: a flagship fixed radar site just got turned into a recurring target set. Ramat David — one of Israel’s key airbases — has already eaten barrages of Fadi missiles and now a swarm of strike drones supposedly aimed at radars and command posts, with Hezbollah boasting and the IDF keeping very quiet about specific damage. Add in hits on Iranian and IRGC radars by US‑Israeli strikes — Kish Island, Zahedan, Imam Khomeini Airport — and you get a regional contest of who can blind whom faster, not who can “defend civilians” better. ​ Iran’s Cheap War on Billion‑Dollar Sensors While Washington keeps talking about “protecting our forces” and “freedom of navigation,” Iran went straight for the US early‑warning grid: an AN/TPY‑2 THAAD radar in Jordan confirmed destroyed, radar buildings in the UAE damaged, a billion‑dollar AN/FPS‑132 site in Qatar visibly scarred, with Site 512 in Israel suddenly looking a lot less immortal than the PowerPoints promised. Each radar costs in the hundreds of millions; each kamikaze drone runs in the tens of thousands — a beautiful kill ratio if you’re Tehran or a defense‑industry shareholder. ​ OSINT accounts stitch it all together: craters at Muwaffaq Salti, burn marks on Umm Dahal’s giant radar face, THAAD sites in the UAE punched in, maps of “US‑linked locations hit by Iran + high‑value radars confirmed damaged or destroyed.” In public, Pentagon spokespeople refuse to discuss “specific capabilities”; in commercial imagery, billions of dollars of “specific capabilities” are sitting in smoking holes. ​ Strategic Meaning: The Radar War The pattern is simple and ugly: Iran and Hezbollah are waging a sensor war, not just a missile war. Knock out or degrade Meron, THAAD eyes in Jordan, the warning radar in Qatar, radar complexes in the UAE, and you don’t need to shoot down every interceptor — you just make them late, blind or fired in the wrong direction. Israel hasn’t lost its entire ground‑based radar network, but the regional early‑warning architecture that was sold as near‑invulnerable has already taken a hit that no spin about “redundancy” can fully erase. ​ And that’s the punchline: the West poured fortunes into layered missile defense to feel untouchable, while Iran and Hezbollah invested in drilling cheap holes in the eyes of the system — with OSINT providing the after‑action report in real time. ​ #IranWar#Israel#Hezbollah#USA#radar#THAAD#Meron#Site512#OSINT#missileDefense#war#geopolitics#militaryindustrialcomplex#fakeSecurity 📱American Оbserver - Stay up to date on all important events 🇺🇸