Один из самых удобных способов записать данные это использование готовых форматов, такие как 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
🌹Spoken English🌹
When you watch something very impressive, you may say:
1 Everybody seems captivated by it😍
2 You seem mesmerized 🤩
3 I was moved to tears,actually 😪😍
4 That's a show stopper!👏👏👏👌
5 I can't take my eyes off of this😍
6 Wow! This is so spectacular!👏👏👏
7 This is breathtaking!😲🤩
#SpokenEnglish
#TeamJimmy
@SirJimmy
🌹Spoken English🌹
When you watch something very impressive, you may say:
1 Everybody seems captivated by it😍
2 You seem mesmerized 🤩
3 I was moved to tears,actually 😪😍
4 That's a show stopper!👏👏👏👌
5 I can't take my eyes off of this😍
6 Wow! This is so spectacular!👏👏👏
7 This is breathtaking!😲🤩
#SpokenEnglish
#TeamJimmy
@SirJimmy
🌹Spoken English🌹
When you watch something very impressive, you may say:
1 Everybody seems captivated by it😍
2 You seem mesmerized 🤩
3 I was moved to tears,actually 😪😍
4 That's a show stopper!👏👏👏👌
5 I can't take my eyes off of this😍
6 Wow! This is so spectacular!👏👏👏
7 This is breathtaking!😲🤩
#SpokenEnglish
#TeamJimmy
@SirJimmy
💜Spoken English💜
1 We are all square/ We are even= if two people are square, one of them has paid off a debt to the other and neither now owes or is owed any money 💰
2 Vibes- a person's emotional state or the atmosphere of a place that is felt by others: He is always giving off good vibes🧚♀
3 Give it a rest!= It's enough!/ Stop it!🙅🏻♀
4 to catch someone off guard 💂♂️When you caught someone doing something and it was very unexpected
5 Take it with a grain of salt 🧂= to understand that something is likely to be untrue or incorrect
#SpokenEnglish
#TeamJimmy
@SirJimmy
#SpokenEnglish
#usefuIlanguage
💥"I'm only razzing you!"
⚡️This phrase is often used in informal contexts to indicate that someone is joking or teasing another person in a playful manner. It suggests that the teasing is not meant to be taken seriously or to hurt feelings.
⚡️If a friend playfully mocks your choice of movie, you might respond with, "Oh, come on! I'm only razzing you!"
💥 "You do you!"
⚜This expression is a way of encouraging someone to be themselves and to pursue their own interests, choices, or lifestyle without worrying about what others think. It promotes individuality and self-acceptance.
⚡️If someone is hesitant about wearing an unconventional outfit, you might say, "Hey, if you like it, you do you!"
💥"The credits roll, but the story lingers."
⚜This phrase suggests that even after an event has concluded (like a movie ending with credits), the impact or essence of the experience continues to resonate or affect people. It implies that stories, emotions, or lessons learned endure beyond their immediate context.
⚡️ After finishing a powerful film, you might reflect, "The credits roll, but the story lingers in my mind long after."
Rumor has it that
'Rumor has it' is an expression used when suggesting you might have heard something or read about something that is taking place now or in the future. A rumor is not a fact.
🖱, "Rumor has it that the player will get traded."
🖱, "Rumor has it that she cheated on him."
🖱, "Rumor has it that they are going to get married."
🖱, "Rumor has it that you like to paint."
🖱, "Rumor has it that show is going to end."
🖱, "Rumor has it that your sister got in trouble."
🖱, "Rumor as it that she goes to our gym."
#spokenEnglish
#phrases
#teamjimmy
#sirjimmy
Let’s be real: You’ve probably seen a list like this 1,000 times. It looks repetitive, maybe even "dumb." But here is why it actually matters for you:
When you only have one word for everything (like "Good"), your brain "glitches" when you're trying to speak fast. You hesitate because you're searching for variety but your "vocabulary folder" is empty. 🧠
The Secret to Speaking Fast:🛫
Fluency isn't about knowing the hardest words; it's about having options. When you have 3-4 ways to say the same thing, your brain doesn't have to stall. It just picks the next available word and keeps the flow going.
-
#English#SpeakEnglish#EnglishTips#Vocabulary#SpokenEnglish