Один из самых удобных способов записать данные это использование готовых форматов, такие как JSON или YAML.
Из плюсов такого подхода стоит отметить вот что:
🔸 готовый, повсеместно используемый и поддерживаемый формат
🔸 простой и понятный файл, удобочитаемый для человека
🔸 можно легко редактировать в любом текстовом редакторе без специальных программ и библиотек
Но есть и минусы
🔹 затраты времени при записи файла (кодирование данных в нужный формат строки)
🔹 затраты времени при чтении файла (декодирование данных в Python объекты)
🔹 размер файла увеличивается из-за разметки данных (скобки, запятые, переносы, отступы...)
🔹 перед записью все данные должны быть помещены в память в полном объёме (не всегда)
🔹 при чтении необходимо считать весь файл в память и только потом декодировать данные
Если нужно писать немного данных в несколько файлов, то затраты по времени не ощутимы. Обычно это файлы конфига или какие-либо метаданные. Это отличный вариант под такие задачи.
Есть и другой поход к записи файлов - это бинарные файлы. Используется, когда данных достаточно много и никто их не собирается читать глазками😳.
🔸 очень быстрая запись
🔸 чтение значительно быстрей чем JSON, YAML итд
🔸 размер файла значительно меньше, так как нет разметки
🔸 можно записывать данные по мере поступления не загружая всё в память
🔸 можно извлечь любую часть данных независимо
Из минусов
🔹 нужно определить свой формат записи данных (если не используете готовую спецификацию определённого формата)
🔹 не получится открыть файл и визуально понять что там записано, а для чтения файла потребуется знать его спецификацию.
🔹 не так-то просто создать такой файл без специальной библиотеки
В таком виде удобно записывать большой массив любых однородных данных. Например, мониторинг валютной биржи или кэшированная анимация 3D геометрии.
(Это не означает что нельзя записать данные разного типа, просто это будет не так удобно)
Представьте себе JPG-картинку. По сути это немного мета-информации и большой массив пикселей. Тоже самое со звуком или видео файлом. Поэтому, если вы попробуете открыть картинку в текстовом редакторе вы увидите что-то вроде такого
f15d cd29 a564 4578 ...
09e2 9bc4 a696 1253 ...
84e9 4de1 3b23 c24a ...
2534 5161 28e0 709d ...
...
Это и есть записанные байтики. И для их чтения требуется определённый софт который знает что с ними делать. Под каждый тип файла.
К чему это я? Читайте в следующем посте...
#tricks#basic
#Eritrea rejects #Ethiopia’s accusations as “false and fabricated” amid rising diplomatic tensions
Eritrea has dismissed recent accusations by Ethiopia as “patently false and fabricated,” rejecting claims made by Ethiopia’s Foreign Minister and describing them as part of what it called a prolonged pattern of hostility toward Asmara.
In a statement issued Monday, 09 February 2026 Eritrea’s Ministry of Information said the accusations were “astounding in tone and substance” and questioned what it described as the underlying motivations behind the claims.
The statement characterized the allegations as “yet another deplorable act in a pattern and spiral of hostile campaigns against Eritrea for more than two years now.”
https://addisstandard.com/?p=55101
War: Ethiopia’s Indelible Scar and a Call for Peace! Read more.
https://borkena.com/2026/02/08/war-ethiopias-indelible-scar-and-a-call-for-peace/#Ethiopia#Eritrea
Protestas de refugiados de #Eritrea en #Israel frente a la embajada de aquel país
https://www.telam.com.ar/notas/202309/638999-140-heridos-israel-eritrea.html
Eritreans, Ethiopians Among Those Wounded In Iranian Attack In UAE. Read.
https://borkena.com/2026/03/01/eritreans-ethiopians-among-those-wounded-in-iranian-attack-in-uae/#Ethiopia#Eritrea#News
Standing Against Unholy Alliances. Read more.
https://borkena.com/2025/11/04/ethiopia-and-eritrea-standing-against-unholy-alliances/#Ethiopia#politics#Eritrea
#Ethiopia faces renewed strain with #Tigray and #Eritrea
Across the northern Tigray region, citizens are bearing the burden of political fractures and rising tensions. Diplomats are urging restraint amid a troop buildup along the borders with Tigray and neighboring Eritrea.
A sense of anxiety is hard to miss in Tigray. Though the 2022 Pretoria peace agreement brought an end to fighting between the Ethiopian National Defense Force (ENDF) and the Tigray People's Liberation Front (TPLF), many in Tigray say life today is like walking on eggshells.
The TPLF, once the dominant party in Ethiopia's ruling coalition (EPRDF) and the region's political anchor, has split into rival factions competing for influence, leaving residents unsure who truly speaks for them.
The political division has created a vacuum. Meanwhile, Ethiopia's federal government accuses Eritrea of supporting the TPLF, an accusation the TPLF and Asmara deny.
https://www.dw.com/en/ethiopia-faces-renewed-strain-with-tigray-and-eritrea/a-76056011
Rising tensions among #Ethiopia, #Eritrea, #Tigray Region raise fears of renewed conflict, International Crisis Group warns
Tensions between Ethiopia’s federal government, Eritrea, and the Tigray region are rising sharply, raising concerns about a possible return to large-scale conflict three years after the end of the Tigray war, the International Crisis Group warned in a new analysis. The group said the fragile peace that followed the November 2022 Pretoria agreement faces multiple stress points and warned that miscalculation could trigger renewed violence with regional consequences.
The report recalls that the war pitted the Tigray People’s Liberation Front against Ethiopian federal forces, Eritrean troops, and regional militias, leaving tens of thousands dead, hundreds of thousands displaced, and infrastructure heavily damaged. While the peace deal halted major fighting, the group said it left unresolved political and security tensions both within Tigray and across the Horn of Africa.
According to the analysis, relations among the key actors have since deteriorated. Prime Minister Abiy Ahmed’s pursuit of sovereign sea access is viewed by Eritrea as a potential threat, while Addis Abeba has accused Tigrayan actors of coordination with Eritrean elements and local militias. Internal divisions in Tigray have also intensified, including rivalry between factions linked to Debretsion Gebremichael and those associated with former interim leader Getachew Reda, with sporadic clashes reported in disputed areas.
The group added that broader regional dynamics heighten the risks. The ongoing conflict in Sudan, competing alliances involving Egypt, and allegations of links with the Rapid Support Forces could further complicate the security landscape.
Despite rising tensions, Crisis Group noted signs of restraint, citing economic costs, military fatigue, and internal divisions as factors limiting immediate escalation. However, it warned that continued military posturing, proxy alignments, and unresolved territorial and political disputes could quickly destabilize the situation, urging urgent diplomatic engagement by African and international partners to prevent renewed conflict.
https://www.crisisgroup.org/brf/africa/ethiopia-eritrea/b210-ethiopia-eritrea-and-tigray-powder-keg-horn-africa
The Gambit’s Hidden Dimensions—Beyond the “Boomerang” Thesis. Read more.
https://borkena.com/2025/12/30/red-sea-the-gambits-hidden-dimensions-beyond-the-boomerang-thesis/#Ethiopia#Eritrea#RedSea
Can Eritrea Legally Deny Ethiopia an Outlet to the Edge of the Sea? Read more.
https://borkena.com/2025/11/25/can-eritrea-legally-deny-ethiopia-an-outlet-to-the-edge-of-the-sea/#Ethiopia#Eritrea#RedSea
#EU urges leaders to exercise responsibility amid #Ethiopia–#Eritrea tensions
The European Union has called on Ethiopia and Eritrea to ease rising tensions through diplomacy and cooperation, warning against a return to conflict in the Horn of Africa. Speaking to journalists in Addis Ababa, Olaf Skoog, Deputy Secretary-General of the European External Action Service, said disputes should be resolved “through diplomacy in good faith,” as concerns grow over Red Sea security.
Addressing escalating rhetoric between Addis Ababa and Asmara, particularly over access to the Red Sea, Skoog urged both sides to step back from confrontational language and pursue cooperative approaches. He said the EU is ready to support de-escalation efforts and act as an “honest broker.”
On Somaliland, Skoog reaffirmed the EU’s support for Somalia’s sovereignty and territorial integrity, rejecting recognition and warning against actions that could further destabilize the region.
Watch
https://www.youtube.com/watch?v=YsYxNFHqJgM