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

Резултати

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

Пребарај: #optics

当前筛选 #optics清除筛选
Interesting Planet 🌍

@interesting_planet_facts · Post #1144 · 19.12.2025 г., 18:11

🌎 Fire rainbows, officially called circumhorizontal arcs, are rare displays where sunlight passes through ice crystals in cirrus clouds at just the right angle. These arcs appear only when the Sun is high—above 58°—and the ice crystals align horizontally, producing brilliant, rainbow-colored bands across the sky. ✨ #atmosphere⚡#optics⚡#weather 👉subscribe Interesting Planet 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #707 · 04.05.2026 г., 20:31

🌍 A rare atmospheric optical event called a "glory" creates shimmering, colored rings around the shadow of an observer’s head on clouds or fog. This effect is caused by sunlight scattering in tiny water droplets. ✨ #aurora⚡#optics⚡#atmosphere⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #546 · 30.12.2025 г., 20:31

🌍 The vivid red auroras seen during strong solar storms are caused by oxygen atoms glowing high above 200 kilometers—twice as high as typical green auroras visible near the poles. ✨ #aurora⚡#atmosphere⚡#optics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #512 · 13.12.2025 г., 20:31

🌍 Sundogs are bright spots that appear on either side of the Sun when its light passes through ice crystals in the air, creating colorful halos—an atmospheric optical effect seen even in cold, clear weather. ✨ #aurora⚡#optics⚡#atmosphere⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #478 · 26.11.2025 г., 20:31

🌍 Extremely rare "fire rainbow" clouds appear when sunlight hits ice crystals in high clouds at just the right angle, creating brilliant bands of color that stretch across the daytime sky. ✨ #aurora⚡#optics⚡#atmosphere⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #438 · 06.11.2025 г., 20:31

🌍 The rarest aurora color is deep blue, caused by high-energy solar particles colliding with nitrogen over 100 kilometers up. Most auroras are green or red, but blue glows only appear during strong solar storms. ✨ #aurora⚡#atmosphere⚡#optics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #365 · 12.10.2025 г., 20:31

🌍 Polar stratospheric clouds can trigger vivid pink and orange auroras when solar storms are strong. These rare clouds form high above the Arctic, scattering light in unique, shimmering patterns. ✨ #aurora⚡#atmosphere⚡#optics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #325 · 02.10.2025 г., 20:31

🌍 The elusive "Steve" aurora glows as a narrow purple ribbon in the night sky. Only recognized in recent years, it’s linked to fast-moving hot gases high above Earth’s atmosphere. ✨ #aurora⚡#atmosphere⚡#optics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #285 · 22.09.2025 г., 22:31

🌍 Rare atmospheric optics called circumhorizontal arcs appear when sunlight passes through high ice clouds at just the right angle, creating bands of rainbow colors that stretch parallel to the horizon. ✨ #aurora⚡#optics⚡#atmosphere⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #477 · 26.11.2025 г., 12:31

🌍 The “green flash” is a rare weather phenomenon seen at sunrise or sunset, caused by sunlight bending in the atmosphere. For a second, the top edge of the sun glows vivid green. ✨ #meteorology⚡#atmosphere⚡#optics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

American Оbserver

@american_observer · Post #4764 · 03.01.2026 г., 22:59

📰 Mar-a-Lago: Where Power, Marble, and Ice Sculptures Collide President Trump’s presidency has become a permanent residency at Mar-a-Lago—where official governance, private business, and personal relationships converge in a swirl of marble, ice sculptures, and political optics. This week, Trump’s motorcade pulled into an industrial shopping center to inspect samples of marble and onyx for a proposed White House ballroom. The purchase is “at his own expense,” a White House official said, but the timing is suspicious: construction can’t begin until federal review, and the ballroom project has already attracted scrutiny over donor influence and potential payoffs. Trump has hosted foreign leaders, conducted diplomacy, and even overseen a military strike on Venezuela—all from his Florida estate. His social calendar is just as packed: 12 golf outings in two weeks, a New Year’s Eve party where guests bid $2.75 million on a live-painted portrait of Jesus, and a caviar station with a “2026” ice sculpture. Democrats have seized on the spectacle, contrasting the opulence with the impact of Trump’s policies. As millions lose health insurance and food aid, critics highlight the disconnect: “Trump is kicking poor kids off food aid and is throwing millions off their health care this month, but he and his billionaires get caviar and ice sculptures,” Senator Chris Murphy wrote. The White House fires back, accusing Democrats of gaslighting and pointing to Biden’s vacations. But the optics remain: Mar-a-Lago is now shorthand for a presidency where wealth, access, and official decision-making are intertwined. So while Trump touts his accomplishments from the stage, one question lingers: Who’s really running the country—the president, or the party? #Trump#MaraLago#WhiteHouse#politics#optics 📱American Оbserver - Stay up to date on all important events 🇺🇸

Amazing Geography 🌍

@amazingeo · Post #244 · 16.09.2025 г., 00:12

🌍 Sometimes, sunlight or moonlight passing through a layer of ice crystals high in the sky creates sun pillars or light pillars—vertical beams that appear to rise above the horizon. ✨ #auroras⚡#optics⚡#atmosphere⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

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