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

Резултати

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

Пребарај: #russialas

当前筛选 #russialas清除筛选
Russian MFA 🇷🇺

@MFARUSSIA · Post #28436 · 18.02.2026 г., 19:29

🎙 Russia's Foreign Minister Sergey Lavrov’sinterview with Al Arabiya television channel(Moscow, February 17, 2026) Key talking points: #TheArabWorld • We enjoy solid relationships with all Arab countries and their organisations. These include the League of Arab States (LAS), with which we have held about half a dozen ministerial meetings. We also plan to hold the Russia-LAS summit. We also maintain a close relationship with the Gulf Cooperation Council (GCC), which has been maintained by annual events at the level of foreign ministers. #SaudiArabia • Saudi Arabia is the leader of the Arab world, a country of two Holiest sites in Islam, and the author of the Arab Peace Initiative to settle the most complicated and enduring crisis, the Palestinian issue. • Our country regards Saudi Arabia as its strategic partner in the region. We believe that this view is shared by our Saudi colleagues. We are very pleased with our cooperation. • We are developing humanitarian, cultural, educational and sports ties. <...> A few days ago, I had a conversation with my friend, Foreign Minister Faisal bin Farhan Al Saud. One of the issues we discussed concerned the preparation of Intervision International Music Contest, which reflects the striving of Russia and Saudi Arabia to promote traditional values. • We enjoy solid relationships with all Arab countries and their organisations. These include the #LAS, with which we have held about half a dozen ministerial meetings. We also plan to hold the #RussiaLAS summit. We also maintain a close relationship with #GCC. #Iran • Regrettably, Israel and the US went ahead with the strikes [against Iran], creating physical risks and undermining the authority of the #IAEA and the #NPT. The IAEA has exerted unprecedented control, especially in the past years, after the signing of the #JCPOA. Iran was never found violating the Non-Proliferation Treaty or its agreement on guarantees with the IAEA. All risks and political tensions emerged after the US withdrew from the JCPOA in 2018. #Syria • Mutual respect and mutual benefit – these are the principles that have underpinned our relations with Syria from the very beginning, since its establishment. We hold these relations in high regard. • We firmly believe that a multiethnic, multi-confessional state such as Syria must restore its unity, territorial integrity, and sovereignty as swiftly as possible. In this endeavour, we will continue to – and indeed already do – assist Damascus and its new leadership. • As for our military facilities, discussions are ongoing. Let me reiterate: the Syrians are keen for our presence to endure. #Palestine • We should not overlook the fact that the situation in the West Bank is becoming increasingly tense and volatile as a result of Israeli actions, including the recent issuance of directives regulating land acquisition and urban development procedures. Until recently, such matters were coordinated with the Palestinian National Authority. Now, however, unilateral decisions are being taken, and analysis of their likely consequences suggests that little may remain of the territories currently administered by the Palestinian National Authority. Now, however, unilateral decisions are being taken, and analysis of their likely consequences suggests that little may remain of the territories currently administered by the Palestinian National Authority. #UkrainianCrisis • Europe hysterically demands that Russia start talks and that all sides agree that Europe must be part of these talks. <...> Europe has revealed its Nazi essence, which we thought was destroyed with the Hitler’s defeat in WWII. It has turned out to be extremely tenacious. I don’t see what role Europe could play. • We greatly value the stance taken by the Trump administration and personally by the President of the US. We are closely observing Europe’s attempts to dissuade the current Washington administration from its principled stance, as discussed and agreed in Anchorage, Alaska. We remain fully committed to those understandings. Read in full