Один из самых удобных способов записать данные это использование готовых форматов, такие как 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
News: #Jimma University, #Boeing sign partnership to strengthen aerospace education
Boeing and Jimma University have announced a long-term strategic partnership aimed at strengthening aviation sciences and aerospace engineering education and preparing a skilled workforce for #Ethiopia’s growing aviation sector and the wider #African market.
In a statement, the partners said the collaboration will support Jimma University’s recently established Aviation Sciences and Aerospace Engineering Academy through infrastructure upgrades, curriculum enrichment, and community engagement initiatives.
The program is also expected to lay the foundation for developing Jimma into a future aerospace center of excellence.
During the initial phase of the partnership in 2026, the two sides plan to focus on classroom modernization, specialized faculty training, and industry-focused workshops.
Henok Teferra Shawl, managing director for Africa at Boeing, said the .....
Read more; https://addisstandard.com/?p=55631
News: Fuel shortages deepen in #Addis_Abeba, regional cities as drivers endure prolonged queues
Drivers in Addis Abeba and several regional cities report worsening fuel shortages, with prolonged queues and dwindling supplies deepening the strain caused by recent price hikes.
At present, beyond rising costs, fuel is reportedly becoming increasingly scarce in cities including #Mekelle, #Jimma, #Ambo and #Bahir_Dar. Drivers who spoke to Addis Standard described spending hours in queues at fuel stations, often with no guarantee of securing supply.
A public transport driver in Mekelle said the situation has deteriorated sharply. “Beyond the price hike, it feels like fuel is heading toward complete disappearance. We are buying a 20-litre jerrycan for 8,000 birr, and that too after waiting in line for more than five hours,” he said.
Read more: https://addisstandard.com/?p=55586
❗️❗️NEWS❗️❗️
🚀 Elevate Your Future Tomorrow Morning!
Are you ready to take the next step in your professional journey? Jifar Career Training is coming to Eldan School in Jimma for an exclusive, high-impact session!
Where: Eldan School, Jimma
When: Tomorrow Morning ከ 2:30 ጀምሮ አይቀርም
Focus: Career growth, skill building, and professional success.
Don’t just dream about a career—train for it. We are bringing the tools; you bring the ambition.
See you all there!📍#Jimma#JifarCareer#EldanSchool#CareerGrowth
Business: #Dubai-based premier hospitality group partners with #MIDROC to develop 10 hotels across #Ethiopia
The agreement, signed during the Future Hospitality Summit Africa, held at Radisson Blu Hotel, #Nairobi Upper Hill, between 31 March and 01 April 2026, outlines a multi-year rollout of properties across key destinations including #Addis_Abeba, #Hawassa, #Bahir_Dar, #Jimma, and #Langano.
The developments are expected to deliver approximately 1,140 hotel keys, with phased openings planned between 2026 and 2031.
https://addisstandard.com/?p=56250
🗣️#DebateSphere was 🔥🔥🔥🔥🔥
The inaugural edition of Debate Sphere in Bishoftu, Ethiopia kicked off with an intense first round of debates. 20 eager participants, divided into 4 teams, took the stage to tackle pressing issues.
The energy in the room was 💯 as the teams delivered their arguments with eloquence and conviction, captivating the enthusiastic 👏 audience. Judges listened intently, evaluating the persuasiveness and clarity of the presentations.
Friendly handshakes and camaraderie between the teams exemplified the spirit of intellectual discourse, as they engaged in lively rebuttals and challenged each other's perspectives. 🤝
Can't wait to see what's in store for the next destination #Jimma! 🔜🏆
🔅Round 1 pictures🔅
@safelightcommunity
#InspireEmpowerTransform
🔆🔅www.safelightet.org🔅🔆
@SafeLightOfficial
👇JOIN US👇
Telegram | Instagram | LinkedIn | Facebook
#DebateSphere#BishoftuDebate#CriticalThinking#SafelightetIntiatives
#SDG#Transform2032
#MODEL2053
#Agenda2032
#In_Depth_Analysis: The #Hormuz Entanglement: Why #Ethiopia’s fuel crisis is a perfect storm of #war, #graft, and #reform
While the immediate catalyst appears to be the high-stakes military escalation between the U.S., Israel, and Iran, a deeper look reveals that Ethiopia’s fuel misery is a complex entanglement. It is a “perfect storm” where geopolitical vulnerability, a domestic system rotting from within, and a painful macroeconomic experiment have collided to leave 120 million people running on empty.
Until the govt can clean its own house, root out the “senior decision-makers” profiting from the black market, and navigate the treacherous waters of Middle Eastern diplomacy, the accounts emerging from #Gonder to #Jimma to #Ambo, and from #Hawassa to #Bishoftu and #Mekelle, point to an Ethiopia that will remain running on empty.
It will be a country “stalled at the intersection of a distant war it cannot control and a local crisis of governance it has yet to master”...
https://addisstandard.com/?p=56099