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

Резултати

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

Пребарај: #spaceships

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

@cosmomyst · Post #691 · 21.02.2026 г., 22:21

🪐 NASA’s Psyche mission is sending a high-tech spacecraft to the asteroid 16 Psyche, testing a new electric propulsion system called Hall thrusters. Hall thrusters use electricity and magnetic fields to accelerate charged particles (ions) for thrust, offering a more efficient way to travel long distances—demonstrating key technology that could power spaceships to worlds like Ceres or the moons of Jupiter in the future. ✨ #spaceships⚡#propulsion⚡#asteroids⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #666 · 07.02.2026 г., 22:21

🪐 ESA’s Hera mission, launching soon to study asteroid Didymos and its moon Dimorphos, is bringing a new kind of space probe—one equipped with autonomous navigation, letting the spaceship guide itself during its close encounters. This technology, inspired by how insects use simple visual cues to avoid obstacles, could pave the way for future spaceships that explore places like Jupiter’s moon Europa or the rings of Saturn independently, relying less on commands from Earth and more on real-time decisions. ✨ #spaceships⚡#technology⚡#exploration⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #399 · 09.10.2025 г., 20:21

🪐 The future of interstellar travel may rely on building spacecraft capable of withstanding long-duration journeys across vast distances like the 4.37 light-years to Alpha Centauri. NASA’s Starlight project is studying how powerful ground-based lasers could push small, ultra-light probes to a significant fraction of the speed of light—over 100 million kilometers per hour—enabling them to reach nearby star systems in just a few decades rather than millennia. ✨ #spaceships⚡#technology⚡#exploration⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #168 · 21.08.2025 г., 20:11

🪐 The Japanese spacecraft Hayabusa2 demonstrated a glimpse of future spaceship technology by visiting the asteroid Ryugu, collecting samples, and returning them to Earth in 2020. Its advanced ion propulsion system and autonomous navigation allowed it to land and lift off from the tiny asteroid's weak gravity—a feat that opens the door to more complex robotic missions to objects like Bennu and even farther out in the solar system. ✨ #spaceships⚡#exploration⚡#technology⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries

Universe Mysteries 🪐

@cosmomyst · Post #106 · 09.08.2025 г., 16:11

🪐 NASA's Solar System Ambassador program highlights the rapid development of electric propulsion for future spaceships, like the ion engines used on the Dawn spacecraft. Ion engines work by shooting electrically charged atoms, called ions, out of the back of the spacecraft, allowing for extremely efficient travel to distant worlds such as the asteroid Vesta and the dwarf planet Ceres. ✨ #spaceships⚡#technology⚡#exploration⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries

Universe Mysteries 🪐

@cosmomyst · Post #627 · 19.01.2026 г., 22:21

🪐 NASA has announced plans for its first nuclear-powered rocket in over 50 years, aiming to test an engine in space by 2027. This new technology, called nuclear thermal propulsion, could dramatically reduce travel time to Mars and distant worlds like Europa by heating hydrogen to generate powerful thrust—making human missions to the outer solar system more achievable than ever before. ✨ #spaceships⚡#technology⚡#Mars⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #567 · 19.12.2025 г., 12:21

🪐 Deep space travelers will experience time differently than people on Earth—a mysterious effect called time dilation. If astronauts took a fast journey to the star Sirius (8.6 light-years away) on a spaceship moving near the speed of light, their onboard clocks would run much slower than those back home, so they would age less during the trip—even while years passed on Earth. This real phenomenon comes straight from Einstein’s theory of relativity and shows how speed itself can turn space voyages into journeys through time. ✨ #timedilation⚡#relativity⚡#spaceships⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #623 · 15.01.2026 г., 12:21

🪐 Scientists studying the future of interstellar travel are exploring how hydrogen harvested from interstellar space—called "ramjet" propulsion—could one day fuel journeys to stars like Alpha Centauri, located over 4 light-years from Earth. A concept known as the Bussard Ramjet proposes using a huge electromagnetic field to collect hydrogen atoms as a spaceship speeds through space, fusing them for energy in the same way stars do, potentially enabling continuous acceleration across vast cosmic distances. ✨ #spaceships⚡#technology⚡#AlphaCentauri⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #508 · 19.11.2025 г., 22:21

🪐 NASA’s upcoming VERITAS mission will send a spaceship equipped with advanced synthetic aperture radar and infrared sensors to Venus, mapping the planet’s surface in detail never achieved before. VERITAS will peer through Venus’s thick clouds to unveil its volcanic terrain and tectonic features, opening a new frontier for robotic exploration in one of the solar system’s most extreme environments. ✨ #spaceships⚡#venus⚡#technology⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #479 · 05.11.2025 г., 12:21

🪐 NASA’s upcoming DAVINCI mission is set to test a new kind of spaceship technology as it descends through the thick atmosphere of Venus in the late 2020s. The spacecraft will use a combination of heat shielding and parachutes designed to survive the planet’s crushing pressure and scorching surface temperatures—over 460°C—pushing the limits of materials and engineering needed for future robotic explorers of extreme worlds like Venus and beyond. ✨ #spaceships⚡#technology⚡#Venus⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #673 · 11.02.2026 г., 12:21

🪐 Scientists are researching how self-healing materials could revolutionize interstellar travel, allowing future spacecraft bound for distant stars like Proxima Centauri to repair themselves from cosmic dust impacts and radiation damage. These advanced materials are designed to sense and fix tiny cracks or holes automatically, greatly increasing the durability and safety of deep space missions as they travel through the harsh, unpredictable environment between the stars. ✨ #spaceships⚡#technology⚡#innovation⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

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