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

Резултати

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

Пребарај: #demographics

当前筛选 #demographics清除筛选
Amazing Geography 🌍

@amazingeo · Post #15 · 10.08.2025 г., 00:12

🌍 In 1800, fewer than 1 billion people lived on Earth. Today, the world population has soared past 8 billion, with more than half living in urban areas like cities and large towns. ✨ #population⚡#urbanization⚡#demographics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍

Amazing Geography 🌍

@amazingeo · Post #211 · 10.09.2025 г., 13:12

🌍 By 2050, city dwellers are expected to make up nearly 70% of the global population. Urban areas are now growing twice as fast as rural regions, reshaping how billions of people live. ✨ #urbanization⚡#cities⚡#demographics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #344 · 07.10.2025 г., 18:31

🌍 More than 1 in 3 people alive today live in just two countries—China and India. Together, their populations make up over 2.7 billion people, shaping trends in language, culture, and the global economy. ✨ #population⚡#demographics⚡#Asia⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #605 · 31.01.2026 г., 20:31

🌍 In November 2022, the world’s population reached 8 billion for the first time, doubling in just 48 years since 1974—a record pace in human history for global population growth. ✨ #population⚡#demographics⚡#growth⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #494 · 04.12.2025 г., 20:31

🌍 In 2023, India gained over 13 million people—more than the total population of some countries. This rapid growth boosts its status as the planet’s most populous nation. ✨ #population⚡#demographics⚡#growth⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #264 · 19.09.2025 г., 09:12

🌍 In 2023, Ethiopia recorded the world’s highest annual natural population increase, adding nearly 2.7 million people in a single year—more than many countries’ entire populations. ✨ #population⚡#demographics⚡#growth⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

International News

@intnewsagency · Post #9345 · 22.04.2026 г., 15:27

Ukraine Considers Raising Retirement Age to 67 Facing a demographic crisis and labor shortages, Ukraine is considering raising the retirement age to 67. Currently, about 10.5 million pensioners equal the number of working-age citizens, straining the pension system. Experts warn the situation will worsen by 2040 due to an aging population. This discussion comes amid record population decline and restrictions on young Ukrainians leaving the country. #Ukraine#pension#demographics#crisis The main news of Russia and the world ishere.

Amazing Geography 🌍

@amazingeo · Post #305 · 27.09.2025 г., 20:31

🌍 Over one million people are added to the world population roughly every five days. The fastest-growing regions are now in parts of Africa, where birth rates remain among the highest globally. ✨ #demographics⚡#growth⚡#continents⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #592 · 25.01.2026 г., 12:31

🌍 In 2022, the number of international migrants reached an estimated 281 million—more than triple the figure from 1970—making up 3.6% of the world’s total population today. ✨ #migration⚡#demographics⚡#movement⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #38 · 12.08.2025 г., 20:12

🌍 India is now the world’s most populous country, with more people than any other nation. Its population surpassed 1.4 billion in 2023, highlighting rapid growth and demographic change. ✨ #India⚡#population⚡#demographics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍

12
ПретходнаСтраница 1 од 2Следна