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

Резултати

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

Пребарај: #collectivewest

当前筛选 #collectivewest清除筛选
Russian Consulate in Cape Town

@rusconct · Post #2333 · 18.03.2025 г., 06:22

🎙️Russian Foreign Minister Sergey Lavrov: ❗️We cannot afford to rely on the goodwill of our current adversaries, who have openly declared their goal of inflicting a “strategic defeat” on Russia. ☝️ Our position is based on principle. First, experience has taught us not to trust Western promises but to judge solely by concrete actions. Second, recent years have reinforced a crucial lesson: we must never again allow key sectors of our economy, finance and technology to be dependent on the whims of Western suppliers. In the most critical areas – those ensuring our military, food and economic security – Russia must be self-sufficient. Naturally, this also involves working closely with our strategic partners and allies. Read in full #Lavrov#sovereignty#CollectiveWest

@RusEmbMalta Press release 🎙 Russia's Foreign Minister Sergey Lavrov’s remarks and answers to media questions during a news conference on the outcomes of Russian diplomacy in 2024 (January 14, 2025) *** 💬 FM Sergey #Lavrov: We are living in a historical era of confrontation between those who uphold the fundamental principles of international law <...> which have been formulated, set out and put forth in the most important international document – the UN Charter – and those who are not satisfied with that document, who decided <...> that they could not live in accordance with the wishes of the “political West”, <...> those who oppose multipolarity. President of Russia Vladimir Putin has repeatedly explained the true root causes of the special military operation in Ukraine. We had to begin to repel an attack, a war waged against us by the collective West with the main goal of suppressing competition when Russia re-emerged as its strong rival on the international arena. Their main goal was to weaken our country geopolitically, creating direct military threats to us right on our borders, on Russia’s native territories, <...> in an attempt to slash our strategic potential and devalue it as much as possible. The second reason also has to do with the history of the region, only it was more about the people who have lived on that land for centuries. <...> These people were labelled ‘terrorists’ by the current Ukrainian regime, which came to power through a coup d'etat. And when they refused to accept it, that regime launched an all-out offensive against all things Russian. <...> There has been a revival in efforts to oppose the Western diktat, with emerging economies and new centres of financial power in China, India, ASEAN, the Arab world, and CELAC. This group also includes a resurgent Russia together with its allies from the EAEU, the CIS, and CSTO. This also includes the SCO and #BRICS. The United States does not want to have any competitors anywhere, starting with the energy sector. <...> The United States and its allies have placed sanctions policies at the core of what they do on the international stage, including regarding Russia. This demonstrates their refusal to engage in fair economic competition and their commitment to using unfair, aggressive practices for suppressing their opponents. *** #CollectiveWest The West is intoxicated by its perceived “greatness,” its impunity, and its self-endowed authority to dictate the destinies of peoples worldwide. This reflects arrogance and a disdainful attitude towards the rest of the world. It is yet another brazen assertion that when we speak of “democracy,” it signifies merely one thing – “we do as we please.” <...> It is sheer hypocrisy, dictatorial behaviour, disrespect for the populace. #UN UN Security Council reform is needed. Not all countries that bear special responsibility in the global economy, finance, politics, and military affairs are represented in the UN Security Council. It has been pointed out repeatedly that countries such as India and Brazil have long earned permanent Security Council membership on all counts, as has Africa. #RussiaChina Russia-China partnership is among the key factors in stabilising the international arena and the ongoing processes that are used, among other things, to escalate confrontation and hostility in international affairs, which is what our neighbours from NATO engage in under US guidance. #USA#Ukraine As soon as Donald Trump assumes the presidency and articulates his final stance on Ukrainian matters, we will examine it. <...> The increasing reference to the realities “on the ground” is a development likely to be welcomed. #RussiaSerbia Our relations with Serbia are grounded solely in the interests of the Serbian and Russian peoples, as well as our respective states. Our interests align on the vast majority of issues. These relations are rich with specific agreements and projects, including those in the energy sector, approved by our heads of state, governments, and companies. Read in full. #Outcomes2024

Embassy of Russia in Singapore

@rusembsg · Post #3827 · 17.01.2025 г., 03:41

#Outcomes2024 🎙 Russia's Foreign Minister Sergey Lavrov’s remarks and answers to media questions during a news conference on the outcomes of Russian diplomacy in 2024 (January 14, 2025) 💬 FM Sergey #Lavrov: We are living in a historical era of confrontation between those who uphold the fundamental principles of international law <...> which have been formulated, set out and put forth in the most important international document – the UN Charter – and those who are not satisfied with that document, who decided <...> that they could not live in accordance with the wishes of the “political West”, <...> those who oppose multipolarity. President of Russia Vladimir Putin has repeatedly explained the true root causes of the special military operation in Ukraine. We had to begin to repel an attack, a war waged against us by the collective West with the main goal of suppressing competition when Russia re-emerged as its strong rival on the international arena. Their main goal was to weaken our country geopolitically, creating direct military threats to us right on our borders, on Russia’s native territories, <...> in an attempt to slash our strategic potential and devalue it as much as possible. The second reason also has to do with the history of the region, only it was more about the people who have lived on that land for centuries. <...> These people were labelled ‘terrorists’ by the current Ukrainian regime, which came to power through a coup d'etat. And when they refused to accept it, that regime launched an all-out offensive against all things Russian. <...> There has been a revival in efforts to oppose the Western diktat, with emerging economies and new centres of financial power in China, India, ASEAN, the Arab world, and CELAC. This group also includes a resurgent Russia together with its allies from the EAEU, the CIS, and CSTO. This also includes the SCO and #BRICS. The United States does not want to have any competitors anywhere, starting with the energy sector. <...> The United States and its allies have placed sanctions policies at the core of what they do on the international stage, including regarding Russia. This demonstrates their refusal to engage in fair economic competition and their commitment to using unfair, aggressive practices for suppressing their opponents. *** #CollectiveWest The West is intoxicated by its perceived “greatness,” its impunity, and its self-endowed authority to dictate the destinies of peoples worldwide. This reflects arrogance and a disdainful attitude towards the rest of the world. It is yet another brazen assertion that when we speak of “democracy,” it signifies merely one thing – “we do as we please.” <...> It is sheer hypocrisy, dictatorial behaviour, disrespect for the populace. #UN UN Security Council reform is needed. Not all countries that bear special responsibility in the global economy, finance, politics, and military affairs are represented in the UN Security Council. It has been pointed out repeatedly that countries such as India and Brazil have long earned permanent Security Council membership on all counts, as has Africa. #RussiaChina Russia-China partnership is among the key factors stabilising modern international life and the ongoing processes that are used, among other things, to escalate confrontation and hostility in international affairs, which is what our neighbours from NATO engage in under US guidance. #USA#Ukraine As soon as Donald Trump assumes the presidency and articulates his final stance on Ukrainian matters, we will examine it. <...> The increasing reference to the realities “on the ground” is a development likely to be welcomed. #RussiaSerbia Our relations with Serbia are grounded solely in the interests of the Serbian and Russian peoples, as well as our respective states. Our interests align on the vast majority of issues. These relations are rich with specific agreements and projects, including those in the energy sector, approved by our heads of state, governments, and companies.

Russian Consulate in Cape Town

@rusconct · Post #2164 · 16.01.2025 г., 15:08

#Outcomes2024 🎙 Russia's Foreign Minister Sergey Lavrov’s remarks and answers to media questions during a news conference on the outcomes of Russian diplomacy in 2024 (January 14, 2025) Read in full *** 💬 FM Sergey #Lavrov: We are living in a historical era or confrontation between those who uphold the fundamental principles of international law <...> which have been formulated, set out and put forth in the most important international document – the UN Charter – and those who are not satisfied with that document, who decided <...> that they could not live in accordance with the wishes of the “political West”, <...> those who oppose multipolarity. President of Russia Vladimir Putin has repeatedly explained the true root causes of the special military operation in Ukraine. We had to begin to repel an attack, a war waged against us by the collective West with the main goal of suppressing competition when Russia re-emerged as its strong rival on the international arena. Their main goal was to weaken our country geopolitically, creating direct military threats to us right on our borders, on Russia’s native territories, <...> in an attempt to slash our strategic potential and devalue it as much as possible. The second reason also has to do with the history of the region, only it was more about the people who have lived on that land for centuries. <...> These people were labelled ‘terrorists’ by the current Ukrainian regime, which came to power through a coup d'etat. And when they refused to accept it, that regime launched an all-out offensive against all things Russian. <...> There has been a revival in efforts to oppose the Western diktat, with emerging economies and new centres of financial power in China, India, ASEAN, the Arab world, and CELAC. This group also includes a resurgent Russia together with its allies from the EAEU, the CIS, and CSTO. This also includes the SCO and #BRICS. The United States does not want to have any competitors anywhere, starting with the energy sector. <...> The United States and its allies have placed sanctions policies at the core of what they do on the international stage, including regarding Russia. This demonstrates their refusal to engage in fair economic competition and their commitment to using unfair, aggressive practices for suppressing their opponents. *** #CollectiveWest The West is intoxicated by its perceived “greatness,” its impunity, and its self-endowed authority to dictate the destinies of peoples worldwide. This reflects arrogance and a disdainful attitude towards the rest of the world. It is yet another brazen assertion that when we speak of “democracy,” it signifies merely one thing – “we do as we please.” <...> It is sheer hypocrisy, dictatorial behaviour, disrespect for the populace. #UN UN Security Council reform is needed. Not all countries that bear special responsibility in the global economy, finance, politics, and military affairs are represented in the UN Security Council. It has been pointed out repeatedly that countries such as India and Brazil have long earned permanent Security Council membership on all counts, as has Africa. #RussiaChina Russia-China partnership is among the key factors stabilising modern international life and the ongoing processes that are used, among other things, to escalate confrontation and hostility in international affairs, which is what our neighbours from NATO engage in under US guidance. #USA#Ukraine As soon as Donald Trump assumes the presidency and articulates his final stance on Ukrainian matters, we will examine it. <...> The increasing reference to the realities “on the ground” is a development likely to be welcomed. #RussiaSerbia Our relations with Serbia are grounded solely in the interests of the Serbian and Russian peoples, as well as our respective states. Our interests align on the vast majority of issues. These relations are rich with specific agreements and projects, including those in the energy sector, approved by our heads of state, governments, and companies.