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 слични објави

Пребарај: #euthieves

当前筛选 #euthieves清除筛选

🎙Russia's Foreign Minister Sergey Lavrov’s interview with RIA Novosti(November 9, 2025) Read in full (Telegraph) #RussiaUS#NewSTART ❓ Question: President of Russia Vladimir Putin announced that the Russian Federation is prepared to continue adhering to the restrictions established by New START for one additional year, starting February 5, 2026. Has there been any response from the United States? Did Moscow propose a meeting with Washington to discuss the post-New START period? If so, at what level? 💬Sergey Lavrov: The constructive initiative put forward by President Vladimir Putin in the post-New START context speaks for itself. It contains no hidden agenda and is perfectly clear for understanding. Its practical implementation would not require any special additional efforts. <...> The only thing required is reciprocity from the United States: we will voluntarily adhere to the restrictions only if, and precisely for as long as, the other side does the same. <...> So far, there has been no substantive response from Washington. We have been informed through diplomatic channels that “the issue is under consideration.” We have no intention of keeping persuading anyone. We believe that our step serves the interests of both parties and the entire international community. 👉 We are ready for any development of events, while hoping for a positive outcome. #Ukraine#RussiaUS ❓ Question: What is currently the main stumbling block in the negotiations with the United States on a settlement around Ukraine? Where is Russia ready to make concessions and where is it not? 💬Sergey Lavrov: <...> We are currently awaiting confirmation from the United States that the Anchorage agreements remain in effect. I would emphasise that, despite their essentially compromise nature, we have not abandoned – and do not intend to abandon – the points that are fundamental for us. ❗️ No one disputes the territorial integrity of the Russian Federation or the choice made by the residents of Crimea, Donbass, and Novorossiya, who made their historic decision to reunite with their homeland through the referendums in 2014 and 2022. We likewise do not forget the need to eliminate the root causes of the conflict. #EUthieves ❓ Question: What will be Russia’s response if the frozen assets of the Russian Federation are directed to support Kiev? 💬Sergey Lavrov: <...> Such actions amount to outright deception and theft. It seems that the long-dormant instincts of colonialists and pirates have reawakened among Europeans. No matter how the scheme for seizing Russian funds is presented, there is no lawful way to carry it out. The confiscation of our gold and foreign currency reserves will not save the Europe’s protégés in Kiev <...> Russia will respond to any predatory actions appropriately, in accordance with the principle of reciprocity, our national interests, and the need to compensate for the damage caused to us. We hope that Brussels and other Western capitals will still come to their senses and abandon this ill-advised venture. #RussiaUS ❓ Question: When and where could a meeting between the Russian and American delegations on mutual “irritants” take place? What about your meeting with US Secretary of State Marco Rubio? When and where might it be held? 💬Sergey Lavrov: There are indeed many irritants in Russia-US relations, most of them inherited from the previous US administration. It will take considerable time to clear up this mess. <...> From our perspective, it is important that this dialogue should not be limited solely to embassy-related issues. We consider it essential to address broader questions, including the restoration of direct flights and the return of Russian diplomatic property. <...> Secretary of State Marco Rubio and I share an understanding that maintaining regular communication is essential, both for discussing the Ukrainian issue and for advancing the broader bilateral agenda. We remain in contact by phone and are prepared to hold in-person meetings.