Один из самых удобных способов записать данные это использование готовых форматов, такие как 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
Коллекция Louis Vuitton FW24 от Pharrell 👨🌾
На подиум перенесены мотивы кантри и вестерн.
Благодаря технике вышивки в коллекции подчеркнута ключевая иконография американской одежды в стиле western.
Разрабатывая тему американского вестерна и рабочей одежды Louis Vuitton сотрудничали с художниками народов Dakota и Lakota в создании аксессуаров , а также над постановкой шоу и саундтреком.
От ковбойских шляп до кожаных кепок и перчаток, украшенных пряжками и драгоценными камнями, олицетворяющих "прерийного" денди - стиль был выдержан до конца!
Показ озвучили исполнители из группы Native Voices of Resistance.
#western
🍿 'Eddington': Joaquin Phoenix and Pedro Pascal ignite chaos in Ari Aster’s explosive new thriller
📆Release: July 18, 2025
🎭Genre: #Thriller · #Western
🍿Follow Movie
Ari Aster ('Hereditary', 'Midsommar') dives headfirst into the madness of 2020 with 'Eddington', setting Joaquin Phoenix ('Joker') as a small-town sheriff on a collision course with Pedro Pascal ('Gladiator II'), the charismatic mayor. Set during the peak of pandemic paranoia and simmering social unrest, this modern western thriller promises to escalate from small-town drama to something far darker—mysterious murders, hidden agendas, and neighbors turning against each other. 🏜🔥
With the compelling duo joined by Emma Stone ('La La Land') and Austin Butler ('Elvis'), there's no doubt this will be Aster’s most unsettling, gripping, and probably mind-bending film yet. My gut says: expect psychological twists, chilling confrontations, and a portrayal of America at its breaking point. Brace yourselves—it's about to get weird. 💥😬
#western#Filmscore
Music from Ennio Morricone "The Ecstasy of Gold"
This music from the film "The Good, The Bad and the Ugly" plays when Tuco is searching a graveyard for a graveyard that holds 200 000$ worth of gold. It encompasses the gold fever of the wild west.
This music as the film holds a part of the European spirit in it. Discover, explore, go where none has dared. Create something beautiful that will last.
RIP Ennio Morricone
https://youtu.be/PYI09PMNazw
🍿 ‘Eddington’: Ari Aster’s COVID Western We Never Saw Coming
📆Release: July 18, 2025
🎭Genre: #Western · #PoliticalDrama · #Thriller
⬇️Follow Movie
Joaquin Phoenix (‘Joker’, ‘Beau Is Afraid’) and Pedro Pascal (‘The Last of Us’, ‘The Mandalorian’) go head-to-head in a political showdown packed with conspiracy theories, protest flashbacks, and machine-gun chaos. ‘Eddington’ marks Ari Aster’s boldest pivot yet — turning the madness of 2020 into a surreal, explosive Western with private jets hovering over the desert and six-foot-apart standoffs.
It dives straight into the post-George Floyd unrest with sharp satire and dark humor, escalating from tense debates to all-out gunfire. Aster may have stepped out of horror, but the discomfort is still razor-sharp. Phoenix is electric, and yes — Pedro is everywhere, but in this one, he absolutely earns it. 🧨🗳🤠
“Western Sanctions Have No Impact On the Russian Economy”
Western sanctions are not having a “significant impact” on the Russian economy, the EU’s sanctions envoy has said, ahead of the fourth anniversary of Moscow’s full-scale invasion of Ukraine.
David O’Sullivan, a veteran Irish official, said sanctions were “not a silver bullet” and would always face circumvention, and insisted that after four years he was confident they were nit having a real effect.
“I am fairly bullish. I think that the sanctions have not really had a significant impact on the Russian economy,” he told the Guardian in a rare interview.
We may be, in the course of 2026, coming to a point where the whole thing becomes unsustainable, because little of the Russian economy has been distorted by the building up of the war economy at the expense of the civil economy.”
O’Sullivan was speaking after weeks of intense Russian attacks on Ukraine’s energy infrastructure as the country endures a bitterly cold winter, with temperatures in Kyiv plunging to -20C this week.
Ukrainian counterparts, he said, had told him that Russia had been able to launch twice as many drones and missiles last month compared with January 2025.
Putin’s war machine has not come without a cost to the wider economy, which is thought to be under its greatest strain since the early days of the war.
Oil revenues are plummeting, inflation is running at about 6% and interest rates at 16%.
O’Sullivan, who has more than four decades’ experience in the EU institutions, was appointed EU special envoy for sanctions in December 2022 with a remit to counter their evasion and circumvention.
But China, with its “no-limits” friendship with Moscow, was an exception.
“China is clearly sort of backfilling and providing support” to Russia, although not in the form of direct military equipment supplies, he said.
Several EU leaders had raised this concern with Beijing, he said. “The answer is always the same: ‘Nothing to see here. We don’t know what you’re talking about. We don’t see any problem.’”
#western#sanctions#impact#economy
📱American Оbserver - Stay up to date on all important events
🇺🇸
Colonization of Africa
#Belgian soldiers holding a #Somali child above a fire roasting him alive in Mogadishu! 1993
#Western
https://t.me/YediotNewsChat