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

Резултати

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

Пребарај: #greece

当前筛选 #greece清除筛选
International Geographic

@internationalgeographic · Post #5892 · 20.08.2025 г., 15:18

Folegandros Island, #Greece🇬🇷 This tiny paradise offers secluded turquoise bays, delicious seafood, and a beautiful view from the Panagia church on top of the hill.

Hashtags

International Geographic

@internationalgeographic · Post #5776 · 25.06.2025 г., 08:57

Corfu, #Greece🇬🇷 Corfu (also known as Kerkyra) is the northernmost and second-largest of the Greek Ionian Islands. The Greeks themselves use the name Kerkyra. Corfu is a very green and picturesque island. Many tourists find the atmosphere of Corfu to be more Italian than Greek, and there is a reason for this: for 400 years, this landmass in the Ionian Sea belonged to Venice. Here, you will find turquoise bays, luxurious beaches, diverse architecture, and ancient temples.

Hashtags

International Geographic

@internationalgeographic · Post #5701 · 21.05.2025 г., 12:54

Megara, #Greece Wow, that's great, it's an interesting attraction. A railway bike is a unique and exciting way to explore the stunning landscapes of Greece.

Hashtags

International Geographic

@internationalgeographic · Post #5675 · 14.05.2025 г., 14:05

Symi Island, #Greece There is no airport here, so you will be met by boat in a neoclassical harbor with pastel-colored buildings. The island of Simi is famous for the extraction of sea sponges.

Hashtags

Militant Wire

@militantwire · Post #2311 · 19.07.2022 г., 00:00

Militant Wire’s Tom Lord: I just wrote a piece on the killing of Thanos Axarlian, 30 years ago, during a 17N assassination attempt on the finance minister of #Greece. "Remembering 17N's Assassination Attempt on Finance Minister Ioannis Palaiokrassas, July 1992" by @PotempkinBrain https://twitter.com/potempkinbrain/status/1548821545174257664?s=21&t=lWm80Fg8DDtUzXgLKt-nZw

Hashtags

Militant Wire

@militantwire · Post #2166 · 14.06.2022 г., 01:20

🇬🇷🏴#Greece: Anarchist and alleged member of the Conspiracy Cells of Fire, Yannis Michailidis (aka "The Syntagma Archer"), has been taken to hospital on the 21st day of his hunger strike in prison. He has apparently lost more than 10% of his intial body weight: https://twitter.com/potempkinbrain/status/1536475186282872833?s=21&t=Tdg9UGvGARRa9FjQOyGpPA

Hashtags

Voyage.Travel.Tourism

@VOYAGE · Post #1660 · 31.01.2026 г., 13:14

Greece🇬🇷 Astypalea Island, a gem of the Dodecanese, lies in the southeastern Aegean. Its remote location has preserved authentic culture and traditions. On a central hill sits Chora, the historic capital, offering panoramic views of the endless Aegean Sea, crowned by the Venetian-era Querini Castle. 🏰🌊 #Greece | @voyage

Hashtags

Voyage.Travel.Tourism

@VOYAGE · Post #1625 · 13.12.2025 г., 13:14

Greece🇬🇷 Astypalea Island, a gem of the Dodecanese, lies in the southeastern Aegean. Its remote location has preserved authentic culture and traditions. On a central hill sits Chora, the historic capital, offering panoramic views of the endless Aegean Sea, crowned by the Venetian-era Querini Castle. 🏰🌊 #Greece | @voyage

Hashtags

Voyage.Travel.Tourism

@VOYAGE · Post #1077 · 30.08.2024 г., 12:14

🗺Greece 🇬🇷 Corfu Island has long been celebrated as one of the most charming spots in Greece. It captivates with its beauty from the very first glance. Looking at the island from an airplane window, you'll be amazed by its extraordinary emerald color. #Greece @voyage

Hashtags

123•••10•••1617
ПретходнаСтраница 1 од 17Следна