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

Резултати

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

Пребарај: #darkenergy

当前筛选 #darkenergy清除筛选
Universe Mysteries 🪐

@cosmomyst · Post #545 · 08.12.2025 г., 12:21

🪐 The Hubble Space Telescope has helped reveal that most of the universe’s mass is invisible, made up of “dark matter”—an unknown substance detected only by its gravity, which bends light from faraway galaxies in a process called gravitational lensing. Even more mysterious is “dark energy,” discovered through distant supernovae in galaxies like Messier 81, which acts like a force pushing galaxies apart and causing the universe’s expansion to speed up, reshaping our entire understanding of the cosmos. ✨ #darkmatter⚡#darkenergy⚡#universe⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #582 · 26.12.2025 г., 12:21

🪐 The ultimate fate of the universe may come in a dramatic event known as the "Big Rip," where the repulsive force of dark energy—an unseen force causing galaxies like Sombrero Galaxy (Messier 104) to speed away from each other—could grow so strong that it eventually tears apart galaxy clusters, stars, planets, and even atoms themselves. If the Big Rip happens, it would be the final act in cosmic history, ending everything from the largest galaxy clusters down to the smallest subatomic particles in a relentless expansion. ✨ #universe⚡#darkenergy⚡#cosmology⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #698 · 01.03.2026 г., 22:21

🪐 Scientists have used distant supernovae like those in the galaxy NGC 4526 to measure how the mysterious force called dark energy is making the universe expand faster and faster. If this acceleration continues, all galaxies—including NGC 4526, Messier 87, and our own Milky Way—will someday move so far apart that their light can never reach each other again, leading to a lonely, cold, and ever-darkening universe known as "cosmic isolation." ✨ #darkenergy⚡#universe⚡#fate⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #336 · 27.09.2025 г., 12:21

🪐 The universe's fate is still being explored, but observations of galaxies like Messier 87, which are drifting farther apart, show that space itself is expanding faster and faster due to a mysterious force called dark energy. As expansion pushes galaxies beyond view and the last stars—such as our Sun—burn out, the cosmos will grow colder and emptier, leading to an era where only black holes like Sagittarius A* remain, before even they slowly fade away over unimaginable timescales. ✨ #universe⚡#fate⚡#darkenergy⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #221 · 04.09.2025 г., 16:11

🪐 The ultimate fate of the Universe may be driven by dark energy, a mysterious force making galaxies like our Milky Way and Andromeda fly apart ever faster. If expansion continues to accelerate, distant galaxies will disappear beyond our view and stars will eventually burn out, leaving behind cold remnants like white dwarfs and black holes—an era sometimes called the "heat death" or "Big Freeze," when the cosmos grows dark and nearly motionless. ✨ #universe⚡#fate⚡#darkenergy⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #115 · 11.08.2025 г., 03:11

🪐 Deep in the Coma Cluster, a packed group of over 1,000 galaxies, astronomers have measured how dark energy—a mysterious force causing the universe to expand faster over time—stretches the space between galaxies. Observations show that the distance between massive galaxies in the Coma Cluster grows not just from their own motion, but because dark energy is steadily pushing the entire cosmic structure apart. ✨ #darkenergy⚡#galaxyclusters⚡#cosmology⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries

Universe Mysteries 🪐

@cosmomyst · Post #604 · 05.01.2026 г., 22:21

🪐 Scientists studying the distant galaxy cluster MACS J1149+2223 use it as a window into the fate of the cosmos, tracking how the accelerated expansion driven by dark energy might eventually push galaxies so far apart that their light can never reach each other again. Over unimaginable timescales, clusters like MACS J1149+2223 will fade from view as the universe expands, leaving behind only a cold, dark emptiness—an ending known as "cosmic isolation" that awaits even the brightest galaxies. ✨ #universe⚡#expansion⚡#darkenergy⚡#galaxycluster⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #175 · 23.08.2025 г., 00:11

🪐 Within the distant galaxy cluster MACS J1423.8+2404, astronomers have measured the effects of dark energy—a mysterious force causing the universe to expand faster and faster over time. By studying how galaxies in this cluster are drifting apart, scientists collect real-world evidence that dark energy acts like a kind of "anti-gravity," pushing the vast cosmic web ever outward and shaping the fate of everything we see in the universe. ✨ #darkenergy⚡#galaxycluster⚡#expansion⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #688 · 18.02.2026 г., 22:21

🪐 In the Perseus Galaxy Cluster, astronomers have found that its galaxies move in ways that visible matter alone can't explain—pointing to huge amounts of dark matter, an invisible form of matter detected only by its gravity. Surprisingly, dark energy—an even more mysterious force—is also at work here, pushing galaxies apart and accelerating the universe’s expansion, making Perseus a real example of how both dark matter and dark energy shape the cosmos while remaining hidden from our eyes. ✨ #PerseusCluster⚡#darkmatter⚡#darkenergy⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #462 · 28.10.2025 г., 12:21

🪐 The universe’s end might play out as a “Big Freeze,” where expansion driven by dark energy causes galaxies like the Milky Way and Andromeda to drift so far apart that even their light can never reach each other. In this frozen future, after stars such as Proxima Centauri and Betelgeuse have burned out, only black holes and fading remnants like white dwarfs and neutron stars would remain, with temperatures dropping close to absolute zero and the cosmos growing ever darker and quieter. ✨ #universeend⚡#darkenergy⚡#cosmology⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #679 · 14.02.2026 г., 12:21

🪐 In the Virgo constellation, astronomers study galaxy clusters like Virgo Cluster to understand the universe’s endgame, using real data to measure how the mysterious force called dark energy is speeding up cosmic expansion. If this expansion keeps accelerating, even giant galaxies such as Messier 87 will someday drift so far apart that their light can no longer reach each other, resulting in a cold, ever-darkening universe filled with isolated islands of stars. ✨ #VirgoCluster⚡#darkenergy⚡#Messier87⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​