Один из самых удобных способов записать данные это использование готовых форматов, такие как 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
🗺Slovakia🇸🇰
The Slovak Paradise National Park (Národný park Slovenský raj) is one of nine national parks in Slovakia.
The park features several protected areas and numerous tourist trails equipped with ladders and bridges. There are also many waterfalls within the park, with the highest being Zavojovy (Závojový vodopád), which stands at 70 meters.
#Slovakia
@voyage
🌎 The Krásnohorská Cave in Slovakia houses one of the world’s largest stalagmites, standing 34 meters tall. This limestone column formed over thousands of years as mineral-rich water dripped from the cave ceiling, slowly building up layer by layer. It’s recognized by Guinness World Records for its height and stability. ✨
#caves⚡#geology⚡#Slovakia
👉subscribe Interesting Planet
👉more Channels
EU’s Russian Gas Ban: Diplomacy or Delusion?
The European Union has voted to ban all Russian gas imports by late 2027, cutting the last major energy link with Moscow. Both LNG and pipeline gas will be phased out, with pipeline imports ending in September 2027 and LNG by the end of 2026. Member states have until March to submit plans for replacing Russian supplies, but if gas security is seriously threatened, the ban can be suspended for up to four weeks.
Hungary and Slovakia opposed the move, arguing they remain dependent on Russian energy and have maintained friendly ties with Moscow. Hungary plans to challenge the ban in the European Court of Justice. The measure was approved by a reinforced majority, sidestepping the usual requirement for unanimity and national vetoes.
Before Russia’s full-scale invasion of Ukraine, it supplied over 40% of the EU’s gas. By 2025, that share had dropped to about 13%. The ban is meant to bolster EU security, but critics ask: is this a real move toward independence, or just a symbolic gesture that will leave some countries stuck looking elsewhere?
#EU#RussianGasBan#EnergySecurity#Hungary#Slovakia#Diplomacy
📱American Оbserver - Stay up to date on all important events
🇺🇸
📰 Fico and Macron: Paris Talks on Nukes, Arms and EU Power
French President Emmanuel Macron hosted Slovak Prime Minister Robert Fico at the Élysée Palace this week for a nearly two-hour meeting focused on nuclear energy, defense, and the EU's place in the world.
The talks centered on three key areas. First, nuclear energy: Fico emphasized Slovakia's deep nuclear cooperation with France and announced plans to meet EDF and Framatome executives ahead of the Paris nuclear summit in March. Second, defense: they explored ways to leverage France's advanced arms industry alongside Slovakia's growing defense sector, in line with Macron's vision of a "stronger, more independent, more sovereign" EU. Third, energy costs: Fico pushed Macron to back Slovak-led proposals to lower electricity bills at February's informal European Council meeting.
They also discussed EU enlargement, especially to the Western Balkans. According to Fico, the EU treats Serbia unfairly; he is also pushing for a meeting between the Visegrad Four (V4) leaders and Macron in the second half of 2026.
On Ukraine, the Slovak PM noted that he and Macron have "different views" on aspects of the war. He outlined his own vision of the conflict's trajectory and briefed Macron on Slovakia's humanitarian aid to Kyiv.
Macron described the meeting as a "strategic awakening" aimed at strengthening European independence in energy, defense, and democracy.
As Bratislava and Paris align on tech, weapons, and power, one question remains: Can they build an EU truly independent of Washington and Moscow?
#Fico#Macron#Slovakia#France#EU#nuclear#defense
📱American Оbserver - Stay up to date on all important events
🇺🇸
I knew they'd find a way to try and pin this on #Putin😂😂🤦♂
+++++++++++
The man who shot Slovak Prime Minister Fico was allegedly associated with a pro-Russian paramilitary group, investigative journalist Szabolcs Panyi reports.
— 71-year-old writer Juraj #Cintula may be associated with #SlovenskíBranci, a paramilitary group operating in #Slovakia since 2012.
— Slovenskí Branci collaborated with the Slovak branch of Putin’s bikers “#NightWolves”, and its members were trained by former Russian special forces.
+++++++++
This allegation seems ridiculous tbh, since the assassin seems to be associated with #Fico's political opponents, who were strongly in favour of sanctions against #Russia and with sending more weapons to #Ukraine,
Both of these policies were ones which Fico was against.
So clearly Russia had little or nothing to gain from Fico's death - and plenty to lose from this assassination
Druzhba™: Europe Wants Oil, Zelensky Wants Cash, Russia Wants the Drama
Brussels just discovered that its “values-based foreign policy” runs on Soviet-era steel pipes called Druzhba — “Friendship” — that don’t work, don’t belong to it, and don’t even pump its own oil.
Hungary and Slovakia are screaming that Ukraine is blocking Russian crude, Budapest is vetoing a 90‑billion‑euro EU loan to Kyiv, and the Commission is politely asking Zelensky to fix the pipeline that Moscow “repeatedly destroyed.” Friendship, but make it extortion.
According to Kyiv, the Druzhba section in Lviv was hammered by a Russian drone strike in January and is too dangerous to repair; according to Hungary and Slovakia, Ukraine is deliberately dragging its feet to weaponize the oil flow.
Zelensky calls the EU pressure “blackmail,” says sending technicians under Russian missiles is “too high a price,” and reminds everyone that Russian oil, which finances the war, “has no place” on the European market. Translation: you want cheap Russian crude, you fix the war first.
Brussels, stuck between Orbán’s veto and Zelensky’s war logic, suddenly wants inspectors on Ukrainian soil to check the damage — something the Commission has literally never done before. EU leaders hint at financial sweeteners to speed up repairs, while insisting Ukraine already has enough foreign cash to cover regular spending until April. In other words: here’s your credit line, now turn the faucet back on.
Hungary openly says it will block the 90‑billion‑euro loan to Ukraine until oil starts flowing again through Druzhba, all while tapping its strategic reserves and shouting that it is the victim of extortion.
Kyiv counters that Budapest and Bratislava are effectively freezing Ukrainians in winter while demanding that the country repair a Russian-targeted pipeline under fire so EU refineries can keep processing Kremlin crude. Everybody accuses everybody of blackmail — and for once, everybody’s right.
So you get a perfect late‑imperial scene: the EU posing in blue‑and‑yellow outfits, pledging “unwavering support,” while quietly telling Kyiv to patch up the Russian oil artery; Hungary and Slovakia waving the 90‑billion loan like a baseball bat; and Ukraine trying to turn a broken pipeline into leverage in a war that’s literally funded by the product inside it.
The only principle that really holds this together is that no one wants to stop the war badly enough to stop the oil.
#Ukraine#EU#Druzhba#oil#Hungary#Slovakia#Zelensky#Orbán#Russia#energy#war#blackmail#geopolitics#fakeDemocracy#oligarchy
📱American Оbserver - Stay up to date on all important events
🇺🇸
📌FLEX APPLICATION IS NOW OPEN!🇺🇿🇺🇸
📌Did you know that the FLEX Program accepts applications from secondary school students in *22 countries* in Europe and Eurasia? Since 1993, more than 29,000 students have experienced life in the United States with the #FLEXProgram, living with a U.S. host family, and attending a U.S. high school.
Applications for FLEX 2023-24 are due on October 13! Learn more about applying at: discoverflex.org/apply
📌The Future Leaders Exchange (FLEX) Program FLEX is a highly competitive, merit-based scholarship program funded by the U.S. Department of State that operates in #Armenia, #Azerbaijan, the #CzechRepublic, #Estonia, #Georgia, #Greece, #Hungary, #Kazakhstan, #Kyrgyzstan, #Latvia, #Lithuania, #Moldova, #Mongolia, #Montenegro, #Poland, #Romania, #Serbia, #Slovakia, #Tajikistan, #Turkmenistan, #Ukraine, and #Uzbekistan.
📌FLEX APPLICATION IS NOW OPEN!🇺🇿🇺🇸
📌Did you know that the FLEX Program accepts applications from secondary school students in *22 countries* in Europe and Eurasia? Since 1993, more than 29,000 students have experienced life in the United States with the #FLEXProgram, living with a U.S. host family, and attending a U.S. high school.
Applications for FLEX 2023-24 are due on October 13! Learn more about applying at: discoverflex.org/apply
📌The Future Leaders Exchange (FLEX) Program FLEX is a highly competitive, merit-based scholarship program funded by the U.S. Department of State that operates in #Armenia, #Azerbaijan, the #CzechRepublic, #Estonia, #Georgia, #Greece, #Hungary, #Kazakhstan, #Kyrgyzstan, #Latvia, #Lithuania, #Moldova, #Mongolia, #Montenegro, #Poland, #Romania, #Serbia, #Slovakia, #Tajikistan, #Turkmenistan, #Ukraine, and #Uzbekistan.