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

Резултати

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

Пребарај: #ramadanchallenge

当前筛选 #ramadanchallenge清除筛选
WESTER School

@wester_uz · Post #3561 · 11.03.2025 г., 00:00

#RamadanChallenge Lesson 2:🎬 📌Listening: Types of Listening Questions Part 1 and Part 2 👨‍🏫 Speaker: Mr. SaidIslom - Overall: 8.5 (Listening:9.0) 📆 Date: 11.03 ⏰ Time: 06:00 Venue: 📌@westerschool_IELTS

Doniyor Olimjonov English | IELTS

@doniyorieltss · Post #1227 · 24.03.2023 г., 11:15

Many governments think that economic progress is their most important goal. Some people, however, think that other types of progress are equally important for a country. Discuss both these views and give your own opinion. It goes without saying that for a nation to flourish its economy needs to be robust, which may lead many authorities to believe that developments in this field should be their sole priority. However, I believe that there are other, possibly more important, aspects to consider. The natural instinct, when a nation is on the brink of a development or recession, is to question its economic soundness. After all, it is wealth that decides a country's fate in most cases. Take the UAE, a previously desolate dessert that is currently home to hundreds of thousands of high-rise buildings. If it hadn't been for its rich natural resources, it wouldn't have gone from abject 'nothingness' to what is now known as the richest nation in the world. In addition to its affluency, this nation is also renowned for its rich culture, which could be explained by the fact that it is a mainstream tourist destination. People from all backgrounds flock to this place in search of a better life, making it all the more popular. Thus, it is safe to say that the economy should, in fact, get a lot of the attention. But it would be unfair if the economy alone received all the credit for a nationwide success. There are usually other rather obscure sectors that inevitably spotlight economic developments as being responsible for any type of improvement in a country. Without a healthy population, for example, it is almost impossible for a society to exist, let alone thrive. One such example is Africa where, despite its rich resources, sickness and poverty run rampant. The economy doesn't signify at this point, as all the existing resources are squandered on treating the ever-increasing diseases. Education plays another important role in this regard. Having quality or poor education can mark the difference between a bright and a grim future for young people that will one day contribute to the national workforce. In other words, it is schools where any type of development begins. Economic strides are certainly essential — it is thanks to them that a country can compete with its counterparts in wealth and power. However, there won't be an economy to boost unless other types of progress, such as the medical and educational ones, receive the same level of attention, if not more. After all, these are the stepping stones to improved economy, which is the path to a better future. #MyWriting#RamadanChallenge @ieltsulugbeks

Doniyor Olimjonov English | IELTS

@doniyorieltss · Post #1220 · 23.03.2023 г., 02:44

#WritingTask2#Economy#RamadanChallenge Many governments think that economic progress is their most important goal. Some people, however, think that other types of progress are equally important for a country. Discuss both these views and give your own opinion. I will soon send my plan and sample answers for this task. @ieltsulugbeks