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

Резултати

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

Пребарај: #remember

当前筛选 #remember清除筛选
Lsposed Modules Updates Tracker

@lsposed_Modules_Updates_Trackers · Post #6229 · 18.03.2026 г., 15:30

#Remember#rafareborn 模块:eu.hxreborn.remembermysort 简介:Remember My Sort 版本:300-3.0.0 更新时间:2026/03/18 18:13:22 更新日志: 💥 BREAKING CHANGES due to df21727 - migrate to libxposed API 101 (commit by @hxreborn): Migrates from libxposed API 100 to 101. API 100 will no longer be supported once 101 is officially released. An LSPosed Manager with API 101 support may not be @lsposed_Modules_Updates_Trackers | @lsposed_Geeks_Bot

Lsposed Modules Updates Tracker

@lsposed_Modules_Updates_Trackers · Post #6153 · 09.03.2026 г., 21:30

#Remember#rafareborn 模块:eu.hxreborn.remembermysort 简介:Remember My Sort 版本:202-2.0.1 更新时间:2026/03/10 04:51:04 更新日志: 🐛 Bug Fixes ef31320 - prevent dimId from being misinterpreted as the sort direction (commit by @hxreborn) Restores sort preferences for users upgrading from v1.x. @lsposed_Modules_Updates_Trackers | @lsposed_Geeks_Bot

Journey to Fluency

@fluencyinenglish · Post #7068 · 23.04.2019 г., 03:06

‍#grammar #remember #infinitive 1⃣ Remember + Infinitive 1⃣ به خاطر داشتن کاری که باید در اینده انجام دهید 2⃣ Remember + Gerund 2⃣ به خاطر داشتن کاری که در گذشته انجام داده‌اید 🆘 Infinitive: to + Verb 🆘 Gerund: Verb + ing @ieltsstrategies @fluencyinenglish

Journey to Fluency

@fluencyinenglish · Post #6746 · 08.01.2019 г., 06:20

#remember #forget #try @fluencyinenglish ❇️Remember + gerund This is when you remember something that has happened in the past. You have a memory of it, like being able to see a movie of it in your head. I remember going to the beach when I was a child. (= I have a memory of going to the beach). He remembers closing the door. (= He has a memory of closing the door). @fluencyinenglish ❇️Remember + to + infinitive This is when you think of something that you need to do. (And usually, you then do the thing). I remembered to buy milk. (= I was walking home and the idea that I needed milk came into my head, so I bought some). She remembered to send a card to her grandmother @fluencyinenglish ❇️ Forget + gerund This is the opposite of remember + gerund. It's when you forget about a memory, something that you've done in the past. Have we really studied this topic before? I forget reading about it. I told my brother that we'd spent Christmas at Granny's house in 1985, but he'd forgotten going there. @fluencyinenglish ❇️Forget + to + infinitive This is the opposite of remember + to + infinitive. It's when you want to do something, but you forget about it. I forgot to call my mother. (= I wanted to call my mother, but when it was a good time to call her, I forgot. I was thinking about something else, and the idea to call my mother didn't come into my head). She keeps forgetting to bring his book back. @fluencyinenglish ❇️Try + gerund This is when you do something as an experiment. The thing you do is not difficult, but you want to see if doing it will have the result that you want. I wanted to stop smoking, so I tried using nicotine patches. (= Using nicotine patches was easy, but I wanted to know if it would help me stop smoking). She tried giving up chocolate, but it didn't help her lose weight. (It was easy for her to give up chocolate. She gave it up to see if it would help her lose weight, but it didn't). @fluencyinenglish ❇️Try + to + infinitive This is when the thing you do itself is difficult. In the present tense or future tense, this means you might not succeed in doing it. In the past tense, it means that you made an effort to do the thing, but you did not succeed. I'll try to carry the suitcase, but it looks too heavy for me. She tried to catch the bus, but she couldn't run fast enough @fluencyinenglish ❇️Regret + gerund This is when you are sorry about something you did in the past and you wish you hadn't done it. I regret going to bed so late. I'm really tired today. She regrets leaving school when she was sixteen. She wishes that she had studied more and then gone to university. @fluencyinenglish ❇️Regret + to + infinitive We use this construction when we are giving someone bad news, in quite a formal way. The verb is almost always something like 'say' or 'tell' or 'inform'. I regret to tell you that the train has been delayed. The company regrets to inform employees that the London office will close next year. @fluencyinenglish

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