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

TGINSIGHT SIMILAR POSTS

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

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

Один из самых удобных способов записать данные это использование готовых форматов, такие как 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

Резултати

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

Пребарај: #derg

当前筛选 #derg清除筛选
Addis Standard

@addisstandardeng · Post #22037 · 16.04.2026 г., 12:58

#Op_ed: Historical Divides, Emerging Alliances: Shifting politics, rising hopes for dialogue in #Ethiopia Ethiopia’s political crisis reflects not just a struggle for power but “fundamentally conflicting narratives about the country’s formation,” centered on Menelik II, writes Yaekob Yatene. One view sees expansion as “reunification,” while another defines it as “conquest.” These competing narratives have shaped modern politics and institutions. While the #Derg’s “Land to the Tiller” addressed inequality, and ethnic federalism enabled self-rule, both failed to resolve deeper demands for autonomy. Yaekob notes a shift: #Amhara actors now prioritize “the protection and survival of the Amhara,” even exploring “collaboration on the ground” with former rivals. He argues this “decoupling…from pseudo-unionist ideological control” could open space for “interest-based engagement.” https://addisstandard.com/?p=56531

Addis Standard

@addisstandardeng · Post #21469 · 20.02.2026 г., 10:44

#Op_ed: #TPLF at 51: Legacy of transformation, contention On 18 February 2026, the #Tigray People’s Liberation Front (TPLF) marked its 51st anniversary, which Ewnetu B. Debela calls “a milestone," highlighting its role as a "primary architect of the modern state" and “a deeply polarizing force.” Since its 1975 insurgency origins, the TPLF has evolved from a guerrilla movement into a governing elite, overthrowing the #Derg regime and overseeing decades of "sustained economic growth" and infrastructural expansion. Critics note a "concentration of power" that stifled opposition, where "dissent was frequently framed as a matter of national security." “The history of the TPLF resists simple verdicts,” Ewnetu concludes, urging #Ethiopia to pursue “a sober reckoning” with this complex legacy. https://addisstandard.com/?p=55264

Addis Standard

@addisstandardeng · Post #21694 · 12.03.2026 г., 14:55

Mulugeta Bekele: the jailed and tortured scientist who kept #Ethiopian#physics alive Mulugeta Bekele paid a heavy price for remaining in #Ethiopia in the 1970s and 1980s. While many other academics had fled their homeland to avoid being targeted by its military rulers, Mulugeta did not. He stayed to teach #physics, almost single-handedly keeping it alive in the country. But Mulugeta was arrested and brutally tortured by members of the #Derg, Ethiopia’s ruling military junta. “I still have scars,” he says when we meet at his tiny, second-floor office at Addis Ababa University (AAU) in January 2026. Gentle and softly spoken, Mulugeta, 79, is formally retired but still active as a research physicist. In 2012 his efforts led to him being awarded the Sakharov prize by the American Physical Society (APS) “for his tireless efforts in defence of human rights and freedom of expression and education.... https://physicsworld.com/a/mulugeta-bekele-the-jailed-and-tortured-scientist-who-kept-ethiopian-physics-alive/

Addis Standard

@addisstandardeng · Post #21131 · 20.01.2026 г., 09:54

#Book_Review: A Ten Minute Mission: The Least Price for Freedom by W. Hundee Hurrisoo In this book review, Ababiyaa Ahmed Ajmel examines W. Hundee Hurrisoo’s A Ten Minute Mission: The Least Price for Freedom, calling it more than a prison memoir—it exposes the “moral and political logic” behind the #Derg regime’s terror. As editor of Bariisaa, #Ethiopia’s first #Oromo-language newspaper, Hundee saw his symbol of “freedom’s light” targeted for erasure. Arrested under the false pretense of a “ten-minute mission,” he endured “4,040 days” in prisons like the Grand Palace and Maikalawi, where torture tools such as the “Stalin stick” broke bodies. The reviewer emphasizes that “the memoir is not only a record of erasure” but also affirms the Oromo concept of Jirra: “we are here, we exist”—a truth echoed by today’s #Qeerroo generation. https://addisstandard.com/?p=54635

Addis Standard

@addisstandardeng · Post #21511 · 24.02.2026 г., 10:33

#Commentary: From #Derg to #EPRDF to Present: #Ethiopia’s unfinished nation-state-building journey In this commentary, Merera Gudina traces Ethiopia’s persistent instability to failed state-building across the imperial, Derg, and EPRDF eras. He argues each collapse stemmed from rulers prioritizing personal power over the "equality of Ethiopian peoples" and their "thirst for development." Merera recounts how Emperor Haile Selassie’s 60-year reign ended ignominiously, even as hundreds of thousands perished in #Wollo, while the Derg, despite abolishing feudal landholding, succumbed to an "extreme lust for power," enforcing Stalinist "#Red_Terror" and destroying movements. The EPRDF era, meant to resolve the "nationalities question," became a 27-year "crude joke." Today, Ethiopia faces a "final frontier," requiring an end to "political theater" and "sham elections" for genuine unity. https://addisstandard.com/?p=55338