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

Резултати

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

Пребарај: #pixelswap

当前筛选 #pixelswap清除筛选

💣The Largest DeFi Airdrop Event in History on TON is here! Are you ready?✨ A total of over 10,000,000+ $PIX will be distributed and we are happy to remind everyone that DEX tokens have significant value. This airdrop event brings you incredible reward opportunities, and what’s even better is that everyone has a chance to win rewards. Whether you are new to the TON ecosystem or a veteran of TON DeFi, this event invites all influencers to shape the future of TON DeFi with PixelSwap. Here is the instruction how to participate and increase your chances: Read the article 📖 #DeFi#Airdrop#DEX#TON#PixelSwap

💎PixelSwap — The First Weighted Pool DEX on TON #PixelSwap is a distinguished modular #DEX built on the #TON blockchain. Audited by a leading global agency, PixelSwap prioritizes smart contract security as a cornerstone of the project, demonstrating this commitment through significant advancements in security infrastructure. PixelSwap's innovative layered architecture supports a variety of algorithms, including weighted pools and LBP launches. Moreover, PixelSwap facilitates atomic transactions, enabling the execution of complex DeFi scenarios. The team aspires to be one of the most secure projects in the #DeFi space and to contribute to the overall security development of the TON ecosystem. 💎PixelSwap x 🍅Tomarket Recently #PixelSwapbecomes a partner of Tomarket, the incentive-driven platform guiding Web2 users seamlessly into Web3 through gaming, earning, and trading! 😄 With over 42M users and 12M connected wallets, #Tomarket is redefining the Web3 experience by offering an all-in-one ecosystem where users can engage in games, earn tokens through activities, and trade assets across multiple chains — all on a single platform. 💱 By combining PixelSwap's advanced liquidity and trading solutions with Tomarket’s extensive user base, they are set to deliver a powerful ecosystem that enables users to not only swap but also access meaningful rewards and explore deeper engagement opportunities. This collaboration creates an ideal path for users to learn, earn, and stay involved in #Web3. The $PIX Token #TGE in Q4 2024! The team has set aside a substantial allocation of $PIX tokens for the community! Be sure to follow @PixelSwap_io and join the community for the latest updates on the Pre-TGE Airdrop Arena! 💎$PIX token serves as the utility token for #PixelSwap, the only modular #DEX that supports both Weighted Pools and Atomic Swaps on #TON. Join ⚔️Pixel Airdrop Arena and stay tuned for more updates! Official Links⬇️ 🔗LayerPixel: Website | X | Channel | Community | Medium | Bot 🔗PixelSwap: Website | X | Channel | SWAP | Pool 🔗PixelDAO: X | Forum | Chat

⏺PixelSwap Farming Pool in🍅Tomarket #PixelSwap recently partnered with the well-known social platform Tomarket, which allows Web2 users to easily transition to Web3 through games, earnings and trading. There is a new farming pool available in 🍅#Tomarket app where you can get a share of $PIX depending on how much $TOMA you contribute to the pool. The pool starts tomorrow at 10:00 UTC🕓 ✖️Use TOMA to get PIX! #TOMA#PIX#earn#farming