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

Резултати

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

Пребарај: #jets

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

@cosmomyst · Post #693 · 24.02.2026 г., 22:21

🪐 In the star system V Hydrae, located about 1,300 light-years away in Hydra, astronomers have observed mysterious, high-speed "bullets" of hot gas being violently ejected from the dying red giant star. These jets blast out at speeds up to 800,000 kilometers per hour and appear at regular intervals, creating bizarre patterns of moving material that are among the strangest cosmic outflows seen in our galaxy. ✨ #phenomena⚡#stars⚡#jets⚡#nasa⚡#galaxy⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #197 · 27.08.2025 г., 13:11

🪐 In the heart of the Centaurus galaxy NGC 5128, the supermassive black hole devours gas and dust, releasing twin jets of particles that stretch for over a million light-years into space. These jets, visible in both radio and X-ray light, show how black holes can not only swallow matter but also launch some of the most powerful streams of energy in the universe, shaping entire galaxies far beyond their event horizons—the invisible boundaries from which nothing can return. ✨ #blackholes⚡#galaxies⚡#jets⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #3 · 29.07.2025 г., 14:41

🌎 Deep within the constellation Cygnus, the black hole V404 Cygni occasionally unleashes powerful outbursts, ejecting matter at near light-speed in opposing jets. These rare events are so energetic that the black hole briefly outshines its entire host galaxy, offering a fleeting glimpse into the turbulent ballet around stellar remnants. ✨ #blackhole⚡#cygnus⚡#jets 👉subscribe Universe Mysteries

Universe Mysteries 🪐

@cosmomyst · Post #414 · 12.10.2025 г., 20:21

🪐 In the heart of the galaxy IC 310, astronomers have observed a quasar that suddenly switches between a quiet state and violent outbursts, blasting powerful jets of particles close to the speed of light. Quasars are some of the brightest objects in the universe, powered by supermassive black holes devouring matter, and IC 310’s unpredictable behavior shows how even these cosmic engines can rapidly transform, lighting up entire galaxies in moments. ✨ #quasars⚡#jets⚡#galaxies⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #370 · 03.10.2025 г., 22:21

🪐 The quasar PKS 0637-752, located about 7.8 billion light-years from Earth, shoots out a jet of particles more than 2 million light-years long—much farther than the diameter of our Milky Way. Quasars are the brilliant, active centers of young galaxies powered by material falling into supermassive black holes, and these enormous jets show how energy can be launched across intergalactic space by the universe’s most powerful engines. ✨ #quasars⚡#jets⚡#galaxies⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #677 · 13.02.2026 г., 12:21

🪐 At the edge of the galaxy M87, astronomers have tracked knots of matter racing outward in narrow jets from its supermassive black hole at more than 99% the speed of light. These plasma jets are powered by the black hole’s intense gravity and spin, yet how exactly the black hole manages to launch such focused, high-speed streams remains one of astrophysics’ biggest black hole mysteries. ✨ #blackholes⚡#jets⚡#plasma⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #187 · 25.08.2025 г., 13:11

🪐 In the center of the galaxy NGC 2392, also known as the "Eskimo Nebula," astronomers have detected fast, energetic jets of gas blasting outwards at speeds of over 200 kilometers per second. These jets, launched by the dying central star, punch through surrounding shells of glowing gas, creating intricate, layered patterns that make this nebula one of the most visually stunning and mysterious cosmic objects observed by the Hubble Space Telescope. ✨ #nebula⚡#jets⚡#emission⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #188 · 25.08.2025 г., 16:11

🪐 In the galaxy PKS 2014-55, astronomers have discovered a cosmic oddity known as an "X-shaped radio galaxy." This galaxy's energetic jets of particles, powered by a supermassive black hole, create two pairs of huge lobes that form a striking X pattern, suggesting a sudden flip in the black hole's rotation or direction—one of the rarest shapes found among radio galaxies. ✨ #phenomenon⚡#radiogalaxy⚡#jets⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #392 · 08.10.2025 г., 15:21

🪐 In the spiral galaxy NGC 4945, located about 13 million light-years away in the constellation Centaurus, astronomers have measured jets of material shooting out from the galaxy's core at speeds approaching the speed of light—nearly 299,792 kilometers per second. This dazzling velocity, known as "relativistic speed," shows how cosmic engines powered by supermassive black holes can accelerate particles close to nature’s ultimate speed limit, producing jets that blaze across tens of thousands of light-years. ✨ #speedoflight⚡#relativistic⚡#jets⚡#NGC4945⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​