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

Резултати

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

Пребарај: #gravity

当前筛选 #gravity清除筛选
Amazing Geography 🌍

@amazingeo · Post #418 · 27.10.2025 г., 20:31

🌍 Earth’s gravity is just strong enough to keep an atmosphere and liquid water, but not so strong that gases like hydrogen escape quickly. This balance is rare among rocky planets in our Solar System. ✨ #earth⚡#planet⚡#gravity⚡#geography⚡#nature 👉subscribe Amazing Geography 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1210 · 10.01.2026 г., 18:11

🌎 The Great Attractor is a mysterious gravitational anomaly in the universe, pulling our Milky Way and thousands of galaxies towards it at over 600 kilometers per second. This region lies about 150 million light-years away in the direction of the constellation Centaurus, but it is largely hidden by the dense dust and stars of our own galaxy, making its true nature still unknown. ✨ #space⚡#astronomy⚡#gravity 👉subscribe Interesting Planet 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #518 · 24.11.2025 г., 22:21

🪐 The cosmic microwave background contains a hidden signature called the "Sachs-Wolfe effect," where variations in temperature are linked to the gravitational pull of massive structures like galaxy clusters. This effect, first detected in the 1990s using data from the COBE and WMAP satellites, shows how even the oldest light in the universe was influenced by the invisible gravity of objects such as the Coma Cluster and the Great Attractor, providing a glimpse into how matter was distributed across the cosmos more than 13 billion years ago. ✨ #cosmology⚡#gravity⚡#universe⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #745 · 18.04.2026 г., 22:21

🪐 In the galaxy cluster known as the Bullet Cluster (1E 0657-56), a cosmic collision has split ordinary matter—seen as hot X-ray gas—from invisible dark matter, which can only be traced by its gravity. By observing how light from background galaxies bends around the Bullet Cluster, astronomers have created detailed maps showing where dark matter gathers, making this system a real, visual proof that most of the universe’s mass is hidden and does not emit light. ✨ #darkmatter⚡#galaxies⚡#gravity⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #504 · 17.11.2025 г., 22:21

🪐 Astronomers have measured that the Coma Cluster—a giant gathering of thousands of galaxies—stays held together by vast amounts of dark matter, an invisible substance that can't be seen but adds enough gravity to keep the cluster from flying apart. Despite all the stars and gas we observe, dark matter in the Coma Cluster outweighs everything visible by more than five times, showing how this hidden ingredient shapes the largest structures in the universe. ✨ #darkmatter⚡#galaxies⚡#gravity⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #146 · 17.08.2025 г., 13:11

🪐 The spiral galaxy NGC 3198 has helped scientists map the mysterious effects of dark matter—a hidden substance that doesn't emit light, but has enough gravity to control how stars move far from the galaxy's center. By tracing the speeds of stars in NGC 3198’s outer edges, astronomers found they move much faster than visible matter alone can explain, revealing an invisible halo of dark matter wrapped around the galaxy. ✨ #darkmatter⚡#galaxies⚡#gravity⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries

Universe Mysteries 🪐

@cosmomyst · Post #380 · 05.10.2025 г., 22:21

🪐 The supermassive black hole at the center of the Milky Way, Sagittarius A*, was observed by the GRAVITY instrument on the Very Large Telescope in 2018, revealing that blobs of hot gas orbit just outside its event horizon at about 30% the speed of light. This close-up look confirmed extreme gravity effects predicted by Einstein, and for the first time, scientists watched matter whip around a black hole in real time just kilometers from the point of no return. ✨ #blackholes⚡#gravity⚡#milkyway⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #526 · 28.11.2025 г., 22:21

🪐 Astronomers have observed an unusual form of space-time distortion called "frame dragging" around the rapidly spinning black hole in the galaxy XTE J1550–564. Frame dragging is an effect predicted by Einstein’s relativity, where a rotating massive object actually twists nearby space and time, causing the orbits of matter and light around it to precess—showing in real life how intense gravity can physically drag space itself into motion. ✨ #wormholes⚡#spacetime⚡#gravity⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #375 · 04.10.2025 г., 22:21

🪐 In 2015, astronomers using the Hubble Space Telescope watched star light from behind the galaxy cluster Abell 3827 bend and split as it passed through the cluster, a real-life effect of space-time distortion called gravitational lensing. Gravity from massive clusters like Abell 3827 warps the space around them, so light takes curved paths and can appear as multiple, stretched images—direct evidence that space itself can be bent by gravity’s pull. ✨ #wormholes⚡#spacetime⚡#gravity⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #268 · 14.09.2025 г., 00:11

🪐 On Jupiter, time actually ticks a little faster than on Earth! Because Jupiter is much less dense and has weaker gravity at its cloud tops, its gravitational pull slows time down less than Earth's gravity does—a real effect called gravitational time dilation, where clocks in stronger gravity run slower compared to those farther away from massive objects. ✨ #timedilation⚡#jupiter⚡#gravity⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

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