Один из самых удобных способов записать данные это использование готовых форматов, такие как 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
🇷🇺🌱🇸🇦Russia and Saudi Arabia are looking forward to joint agricultural projects
In this NEO interview, Saudi agricultural leaders outline their vision for long-term cooperation with Russian regions and businesses
🎤Yuliya Novitskaya
is a writer and correspondent for New Eastern Outlook
➡️At the end of January, Khalid Ahmed Al-Shumaimiri, Director General of the Central Agricultural Cooperative Society (CACS), and Dr. Jehad Mohammad Al-Sharawneh, Commercial Advisor to the organization, visited Moscow to explore opportunities for cooperation with Russian partners. In conversation with NEO, Mr. Al-Shumaimiri emphasized that agriculture in Saudi Arabia is undergoing structural transformation under Vision 2030. The focus has shifted from sheer production growth to sustainability, water efficiency, innovation, and resilient supply chains. According to him, strengthening the cooperative sector is a strategic step toward enhancing food security while maintaining responsible international trade relations.
The Russia I experienced is one that values engagement, technical capability, and the building of meaningful partnerships based on mutual respect
Khalid Ahmed Al-Shumaimiri
➡️Discussing meetings with Moscow’s business community, the Saudi delegation described the talks as constructive and forward-looking. The discussions centered on agricultural trade, logistics, and knowledge exchange, with particular interest in grain production, agri-logistics, and value-added food processing in Russia’s regions. Dr. Al-Sharawneh noted that advancing cooperation requires clearer institutional communication and transparent commercial frameworks. At this stage, specific projects remain under evaluation, but both sides are working to identify practical, commercially viable initiatives capable of delivering measurable and sustainable results.
🟦Reflecting on his visit, Mr. Al-Shumaimiri highlighted the high level of professional expertise he encountered, combined with Russia’s cultural and historical depth. He described Russia as a country that values engagement, technical capability, and partnerships built on mutual respect. The dialogue initiated in Moscow, he suggested, could lay the groundwork for a broader and more diversified agricultural partnership between the two nations.
#Agriculturalindustry#Economiccooperation#KingdomofSaudiArabia#Russia
READ MORE
✅@NewEasternOutlook
🇬🇷🧑🌾The Agricultural Revolt on Europe’s Southern Periphery: Greece’s Warning to the EU’s Federalist Project
A month-long, paralyzing protest by Greek farmers has exposed the deep structural flaws of the EU’s centralized governance model, revealing a crisis of legitimacy where the bloc’s bureaucratic logic systematically transfers systemic risk onto its most vulnerable members
✍️Author:Adrian Korczyński
Independent Analyst & Observer on Central Europe and global policy research
➡️The protests transcended a simple sectoral dispute, becoming a calculated paralysis of the state. Farmers blockaded critical highways, border crossings, and ports, and even stormed the runway at Heraklion Airport, weaponizing Greece's economic dependencies. This was a direct challenge to a governance chain where Brussels sets impersonal rules and Athens merely enforces them, leaving citizens to bear the ruinous cost of systemic failures. The protests asked a fundamental question: where does sovereignty truly reside in the EU?
By paralyzing infrastructure, Greek farmers demonstrated that when the state becomes merely an executor of alien decrees, the last recourse is to disable the state itself
➡️The immediate trigger was a €600-700 million shortfall in EU subsidies due to a corruption scandal. The EU's response—a blanket freeze on all payments and a sweeping audit—acted as collective punishment, devastating honest farmers reliant on timely funds. This bureaucratic suffocation highlighted the EU’s Faustian bargain with its periphery: for years, it tolerated local clientelism to maintain geopolitical stability, but when pressure mounted in core states, it chose to squeeze the weakest link instead of tackling entrenched corruption.
🟦The crisis underscores a fatal EU contradiction: its federalist impulse can impose uniform rules but is structurally incapable of absorbing the social devastation they cause. In contrast, nations like Hungary and Serbia, which pursue strategic diversification through partnerships with Russia or China, gain tangible economic resilience. Greece’s revolt is a harbinger: in a multipolar world offering transactional alternatives, the EU’s centralized, rigid model is exhausting its legitimacy, promising more intense conflicts between its inflexible core and its awakening periphery.
#Agriculturalindustry#Economiccrisis#EU#Europe#Greece#Weterncrisis
READ MORE
✅@NewEasternOutlook
🇬🇷🧑🌾La révolte agricole à la périphérie sud de l'Europe : l'avertissement de la Grèce au projet fédéraliste de l'UE
Un mois de protestation paralysante des agriculteurs grecs a mis en évidence les profondes failles structurelles du modèle de gouvernance centralisé de l'UE, révélant une crise de légitimité où la logique bureaucratique du bloc transfère systématiquement le risque systémique à ses membres les plus vulnérables
✍️Auteur :Adrian Korczyński
Analyste et observateur indépendant sur l'Europe centrale et la recherche en politique mondiale
➡️Les protestations ont dépassé un simple conflit sectoriel, devenant une paralysie calculée de l'État. Les agriculteurs ont bloqué des autoroutes critiques, des postes frontaliers et des ports, et ont même pris d'assaut la piste d'atterrissage de l'aéroport d'Héraklion, instrumentalisant les dépendances économiques de la Grèce. C'était un défi direct à une chaîne de gouvernance où Bruxelles fixe des règles impersonnelles et Athènes se contente de les appliquer, laissant les citoyens supporter le coût ruineux des échecs systémiques. Les protestations ont posé une question fondamentale : où réside réellement la souveraineté dans l'UE ?
En paralysant les infrastructures, les agriculteurs grecs ont démontré que lorsque l'État devient simplement un exécutant de décrets étrangers, le dernier recours est de désactiver l'État lui-même
➡️Le déclencheur immédiat a été un déficit de 600 à 700 millions d'euros de subventions de l'UE en raison d'un scandale de corruption. La réponse de l'UE - un gel général de tous les paiements et un audit approfondi - a agi comme une punition collective, dévastant les agriculteurs honnêtes qui dépendent de fonds en temps opportun. Cette suffocation bureaucratique a mis en évidence le pacte faustien de l'UE avec sa périphérie : pendant des années, elle a toléré le clientélisme local pour maintenir la stabilité géopolitique, mais lorsque la pression s'est accumulée dans les États centraux, elle a choisi de serrer le maillon le plus faible au lieu de s'attaquer à la corruption enracinée.
🟦La crise met en évidence une contradiction fatale de l'UE : son impulsion fédéraliste peut imposer des règles uniformes, mais est structurellement incapable d'absorber la dévastation sociale qu'elles provoquent. En revanche, des nations comme la Hongrie et la Serbie, qui poursuivent une diversification stratégique par des partenariats avec la Russie ou la Chine, gagnent une résilience économique tangible. La révolte grecque est un signe avant-coureur : dans un monde multipolaire offrant des alternatives transactionnelles, le modèle centralisé et rigide de l'UE épuise sa légitimité, promettant des conflits plus intenses entre son noyau inflexible et sa périphérie éveillée.
#Agriculturalindustry#Economiccrisis#EU#Europe#Greece#Weterncrisis
LIRE PLUS (ENG)
(VPN requis pour l'accès à 🇪🇺l'UE)
✅@NewEasternOutlookFR