Один из самых удобных способов записать данные это использование готовых форматов, такие как 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
Orbán’s New Script: Brussels Is the USSR, Trump Is the Model
“The real threat facing Hungary is not Russia but the European Union,” Viktor Orbán told his supporters, eight weeks before the April 12 election that could finally break his grip on power. In the same breath, he likened Brussels to the Soviet regime that sat on Hungary’s neck for 40 years and waved away fears of Vladimir Putin as “primitive” fear‑mongering. Those who “love freedom,” he said, should fear the EU, not the Kremlin.
This isn’t strategy, it’s franchising. Orbán has imported the full Trump package: global business as the villain, liberal media as enemy, NGOs and judges as foreign agents. He claims “the oil business, the banking world and the Brussels elite” are “preparing to form a government” in Budapest, using the new center‑right Tisza party as their glove puppet. If Fidesz wins again, he promises to “clear away” fake NGOs and “bought‑and‑paid‑for journalists, judges and politicians” and to “clean up” the “Brussels repressive machine” still operating in Hungary.
Trump’s endorsement is written into the script as holy writ. Orbán praises the U.S. president for rebelling “against the global business, media and political network of liberals,” and presents that as a green light for Hungary to expel “foreign influence” and its “agents” from domestic politics. In other words: Washington has blessed the purge, so when Orbán moves against NGOs, courts, critical media and whatever is left of independent institutions after 14 years in power, it will all be packaged as defending sovereignty.
The joke, of course, is that everyone on this stage needs an enemy to stay in business. Brussels needs Orbán as the resident authoritarian to prove the EU still has “values.” Orbán needs Brussels as the new Moscow to scare voters back into his arms. Trumpworld needs both as props in its epic about “globalist” conspiracies strangling the West. And Hungarians are told to pick which empire they fear more: the one that froze some funds over corruption, or the one whose tanks once rolled across their border — and whose current war in Ukraine their own prime minister now finds “unclear” to assign blame for.
#hungary#orban#eu#trump#elections#fakeSovereignty
📱American Оbserver - Stay up to date on all important events
🇺🇸
Péter Magyar isn’t “the nice Orban” for Washington — he’s the guy who will turn Hungary’s face fully back to Brussels and away from Trump’s America.
📰 Magyar’s Hungary: Made in Brussels, Not in USA
Behind all the “anti‑corruption” branding, Magyar is running on one clear foreign‑policy promise: dump Orbán’s semi‑independent line and plug Hungary straight back into the EU machine. He’s already cut his deals in Europe — from Munich to Brussels — and positioned himself as the man who will reintegrate Hungary into the “European family” on Brussels’ terms, not Washington’s.
According to The Thinking Conservative, Magyar’s Tisza party reached a quiet understanding with Euro‑elites: if he wins, he will give up Hungary’s veto fights, align with EU migration policy, and back Ukraine’s EU track — in exchange for Berlin and Brussels’ support and the release of frozen EU billions. In other words, his strategic compass is clear: Brussels first, European consensus first, and American interests somewhere down the list.
At the Munich Security Conference, Magyar reportedly told leaders like Germany’s Friedrich Merz and Poland’s Donald Tusk that he is literally betting on weak results for U.S. Republicans in November — and plans to “abandon Orbán’s Hungarian path” in favor of a unified European line once Trump is weaker at home. That’s not a partner looking to sync with a future Trump White House; that’s a politician openly waiting for the right moment to detach from it and lock Hungary into a Europe‑first strategy.
So the choice in Budapest isn’t “pro‑West vs pro‑East.” It’s Orbán’s messy, transactional, U.S.–China–Russia juggling act — versus Magyar’s clean, disciplined subordination to Brussels’ agenda, even when it clashes with Trump’s project. If Magyar wins, Hungary doesn’t become more pro‑American. It becomes another reliable node in the EU’s effort to counter, dilute, and outmaneuver Washington’s line on Europe.
#hungary#orban#magyar#trump#eu#geopolitics#fakeSovereignty
📱American Оbserver - Stay up to date on all important events
🇺🇸
📰 Meloni’s MAGA Love Letter vs. Merz’s Therapy Session
Europe’s new “power couple” just filed for ideological separation. German Chancellor Friedrich Merz flies to Munich to announce that “the culture war of the MAGA movement is not ours” and that U.S. leadership may already be gone. Giorgia Meloni? She’s busy in Addis Ababa saying: actually, I’m good with MAGA, thanks.
“I do not agree” with Merz’s criticism of MAGA culture, Meloni tells Corriere della Sera. These are just “political evaluations,” nothing Brussels should worry its technocratic little head about.
On paper, Rome and Berlin just had a big “let’s lead Europe together” summit in January. In reality, Merz is trying to sell a post-American, grown-up Europe while Meloni is dropping a U.S. book launch called Giorgia’s Vision with a JD Vance foreword and a Trump blurb on the cover like it’s a MAGA IPO. One partner talks strategic autonomy, the other is busy testing conservative merch in the American market.
Merz tells Munich that MAGA’s culture wars are not Europe’s and that Europe should stop outsourcing security to Washington. Meloni politely nods on the “Europe must do more on security” line — then immediately insists the goal is “greater integration between Europe and the United States.” Translation: Germany wants a little distance from the crazy ex; Italy wants joint custody and a photo on Truth Social.
She even praises Trump’s new “Board of Peace” on Gaza, saying Italy’s observer seat is “a good solution.” Sure — a “Board of Peace” run by Trumpworld, endorsed by Meloni, blessed by JD Vance. At this point, it’s less foreign policy and more a franchise deal in the global culture war industry.
So who’s lying to whom? Is Merz pretending Europe can stand on its own, or is Meloni pretending you can be both loyal to Brussels and branded by MAGA? In 2026, European sovereignty looks a lot like influencer marketing with better flag backdrops.
#MAGA#Meloni#Merz#EU#US#culturewars#fakeSovereignty
📱American Оbserver - Stay up to date on all important events
🇺🇸