Один из самых удобных способов записать данные это использование готовых форматов, такие как 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
#Security vacuum fears grow amid reports of #ENDF withdrawals, alleged redeployment toward #Tigray Region
Withdrawal or reduced presence of federal forces in recent days is raising concerns among local communities. Residents in different parts of the country spoke to Addis Standard on their concern following federal forces evacuating their village while fueling speculation that troops are being redeployed northward amid rising tensions involving Tigray.
Residents in Dirashe district, Gardulla Zone, South Ethiopia Region, and Anfilo districts in Kellem Wollega Zone, Oromia Region, told Addis Standard that Ethiopian National Defense Forces (ENDF) have been vacating certain areas, creating security gaps and fueling local tensions. An AFP report confirmed similar reports of troop movements and heightened military tension near the Tigray border.
https://addisstandard.com/?p=55250
News: #Ethiopia, #Belarus sign military MoU ahead of Air Force’s 90th anniversary
Ethiopia and Belarus have signed a bilateral memorandum of understanding (MoU) aimed at strengthening military cooperation between the two countries, the Ethiopian National Defense Forces (#ENDF) said.
In a statement issued on 22 January 2026, the ENDF said the agreement was signed by Ethiopia’s Minister of Defense, Engineer Aisha Mohammed, and Pantus Dmitry Aleksandrovich, Minister of State Authority for Military Industry of the Republic of Belarus.
According to the statement, Aisha described the MoU as a significant step toward advancing Ethiopia’s military technology and industrial capacity, particularly as the country seeks greater self-sufficiency in defense production.
She also recalled previous agreements reached between the leaders of Ethiopia and Belarus, noting that those understandings provide the foundation for implementing the current strategic cooperation...
Read more: https://addisstandard.com/?p=54710
#ENDF Airborne School graduates combat paratroopers trained for #special_missions
Addis Abeba— The Ethiopian National Defense Force (ENDF) said its Airborne School, under the Special Operations Command Training Center, has today graduated combat paratroopers trained to carry out special missions.
Lieutenant General Shuma Abdeta, Commander of the Special Operations Command, attended the graduation ceremony and pinned “chest wings” on the graduates, according to a statement from ENDF.
Addressing the trainees, Lt. Gen. Shuma said the airborne force “is a cradle of great leaders and heroes,” describing it as a unit that “makes the country proud by concluding formidable and complex missions with victory.”
He added that joining the airborne force requires “exceptional bravery,” noting that a paratrooper must be “a determined hero, invincible to any earthly challenge, and capable of overcoming all obstacles to achieve success.”
https://www.facebook.com/share/1KTQkTwcNF/
News: #Tigray Interim Administration dismisses claims of #ENDF deployment, relocation to Northern Command camps
The Tigray Interim Administration has dismissed as “completely false” reports circulating in recent days alleging that the federal government ordered the #Ethiopian National Defense Forces (ENDF) to enter Tigray and that the regional administration had agreed to the relocation of federal troops to former Northern Command camps.
In a brief statement issued today, the Interim Administration described the claims as “misinformation and disinformation” intended to mislead the public and create unnecessary tension.
“There are rumors in recent days that the federal government has ordered the Ethiopian Defense Forces to enter Tigray, and the Tigray Interim Administration has agreed for the forces to settle in the former camps of #Northern Command,” the statement said.
“The source and the goal of this strategy of spreading such misinformation and....
Read more: https://addisstandard.com/?p=55289
News: Former minister #Gedu says #Eritrean, #Ethiopian forces operated “as a single force” until Pretoria ceasefire, disputes PM Abiy’s account of Asmara’s role in Tigray war
Former Minister of Foreign Affairs Gedu Andargachew has disputed Prime Minister Abiy Ahmed’s recent parliamentary account of Ethiopia’s wartime engagement with Eritrea, saying Eritrean forces fought alongside the Ethiopian National Defense Forces (#ENDF) “effectively as a single force” until the Pretoria ceasefire halted joint operations.
He said he proposed raising the withdrawal of Eritrean forces from Tigray during the visit but was instructed not to do so. According to Gedu, no message concerning the suffering of civilians in Tigray was delivered in Asmara.
In a letter dated 5 February 2026 and sent to Addis Standard, Gedu rejected Abiy’s claim that he served as the Prime Minister’s envoy to Eritrea after the outbreak of the war in Tigray to convey concerns over crimes ....
Read more: https://addisstandard.com/?p=55048
News: #US Assistant Secretary Christopher Landau, AFRICOM commander arrive in #Ethiopia, visit Air Force aviation expo
U.S. Assistant Secretary of State Christopher Landau arrived in Ethiopia today as part of a regional tour that includes #Egypt, Ethiopia, #Kenya, and #Djibouti, scheduled to run from 24 January to 1 February.
The Commander of the U.S. Africa Command (#AFRICOM), General Dagvin Anderson, is also in Ethiopia as part of the visit.
Today, Landau and General Anderson visited the International Aviation Expo organized by the Ethiopian Air Force, according to the Ethiopian National Defense Force (#ENDF). Field Marshal Birhanu Jula, Chief of General Staff of the Ethiopian National Defense Force, also took part in the visit.
The expo showcased aircraft, defense technologies, and related products from the Ethiopian Air Force, the Defense Engineering Industry Group,..
https://www.facebook.com/AddisstandardEng/posts/pfbid021qedgKswfSFzdABsQXmFSvjuiRtWQedXpLYXJysCdk1MBnWvdx4JZJTmEng9jPGRl