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

Резултати

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

Пребарај: #distro

当前筛选 #distro清除筛选
Linuxgram 🐧

@linuxgram · Post #18038 · 12.03.2026 г., 05:50

📰 AlmaLinux 9 and 10 Gain Official NVIDIA CUDA Support NVIDIA now officially supports AlmaLinux for CUDA workloads, with driver and userspace packages available in the distro's repositories. 🔗 Source: https://linuxiac.com/almalinux-9-and-10-gain-official-nvidia-cuda-support/ #distro

Hashtags

Linuxgram 🐧

@linuxgram · Post #18602 · 28.04.2026 г., 14:55

📰Most Linux regret is actually distro regret, and you probably gave up too soon Let's say I'm introducing ice cream to an alien. I get a cone, put a dollop of vanilla ice cream onto it, and hand it over. The alien gives the ice cream a lick, says it doesn't like the flavor, and then states that, as a result, ice cream just isn't for them. Of course, people wouldn't allow the alien to believe that all ice creams taste bad because it didn't like the vanilla flavor; instead, they'd recommend different flavors of ice creams and... 🔗 Source: https://www.xda-developers.com/linux-regret-actually-distro-regret/ #distro#linux

Linuxgram 🐧

@linuxgram · Post #18595 · 28.04.2026 г., 09:56

📰IPFire 2.29 Core Update 201 Linux Firewall Distro Released with DNS Firewall IPFire 2.29 Core Update 201 hardened Linux firewall distro is now available for download with DNS Firewall, Intrusion Prevention System improvements, updated components, and other changes. 🔗 Source: https://9to5linux.com/ipfire-2-29-core-update-201-linux-firewall-distro-released-with-dns-firewall #distro#linux

Linuxgram 🐧

@linuxgram · Post #18557 · 24.04.2026 г., 13:04

📰 Tails 7.7 Anonymous Distro Adds Detection of Outdated Secure Boot Certificates Tails 7.7 anonymous Linux distribution is now available for download with automatic detection of outdated Secure Boot certificates, Tor Browser 15.0.10, and other changes. 🔗 Source: https://9to5linux.com/tails-7-7-anonymous-distro-adds-detection-of-outdated-secure-boot-certificates #distro#linux

Linuxgram 🐧

@linuxgram · Post #18309 · 04.04.2026 г., 13:31

📰 This lightweight Linux distro is what old hardware has been waiting for Void Linux won’t be the right distro for everyone, but on old hardware, its lean design can feel like a second life. 🔗 Source: https://www.xda-developers.com/lightweight-linux-distro-what-old-hardware-waiting-for/ #distro#linux

Linuxgram 🐧

@linuxgram · Post #18160 · 23.03.2026 г., 18:55

📰 Every gaming Linux distro is about to share the same foundation, and it could change everything We finally have an answer to Linux gaming's fragmentation problem. 🔗 Source: https://www.xda-developers.com/every-gaming-linux-distro-share-the-same-foundation/ #distro#linux

Linuxgram 🐧

@linuxgram · Post #18085 · 17.03.2026 г., 09:54

📰 Ageless Linux Emerges to Protest OS-Level Age Verification Laws And thankfully, it's more than just a Linux distro without age verification. 🔗 Source: https://feed.itsfoss.com/link/24361/17300603/ageless-linux #linux#distro

Linuxgram 🐧

@linuxgram · Post #17982 · 05.03.2026 г., 15:18

📰MX Linux 25 may be the best distro for old PCs that nobody talks about If you have an old laptop you're not ready to throw away yet, MX Linux may just be the best way to give it a new life. 🔗 Source: https://www.xda-developers.com/mx-linux-25-may-be-best-distro-old-pcs-nobody-talks-about/ #linux#distro

Linuxgram 🐧

@linuxgram · Post #17917 · 27.02.2026 г., 13:44

📰 Bazzite triples its userbase in 8 months as gamers seek a Windows alternative People have begun to wake up to the idea that, in some situations, installing a gaming-oriented Linux distro will give you a better experience than Windows 11. Once pinned as the one operating system you don't want to use if you care about gaming, Linux has since come leaps and bounds with tech like Proton that allows games to run on the FOSS operating system without the game's developers lifting a finger. 🔗 Source: https://www.xda-developers.com/bazzite-triples-its-userbase-in-8-months-as-gamers-seek-a-windows-alternative/ #linux#distro

Linuxgram 🐧

@linuxgram · Post #17911 · 26.02.2026 г., 21:23

📰 Tails 7.5 Updates Tor Browser to 15.0.7 and Improves Thunderbird Security Tails 7.5, a privacy-focused Linux distro, upgrades Tor Browser to 15.0.7, updates the Tor client to 0.4.9.5, and improves Thunderbird security. 🔗 Source: https://linuxiac.com/tails-7-5-privacy-focused-linux-distro-released/ #linux#distro

Linuxgram 🐧

@linuxgram · Post #18561 · 24.04.2026 г., 17:47

📰 Canonical finally gives Launchpad (a bit of) a glow-up Launchpad, the home of Ubuntu development, has finally received some design attention. Canonical last updated the site’s homepage back in 2024, but many of the pages that the distro’s developers actually use or reference on a regular basis have remained untouched for the best part of a decade. Now that’s starting to change. 🔗 Source: https://www.omgubuntu.co.uk/2026/04/ubuntu-launchpad-website-revamp #distro#ubuntu

Linuxgram 🐧

@linuxgram · Post #18514 · 21.04.2026 г., 17:38

📰 Ubuntu confirms the 26.10 codename, and it sounds strange… Ubuntu has announced the codename for Ubuntu 26.10 is… “Stonking Stingray”. As codenames go it’s certainly unique. The distro gives each release a codename has an alliterative pairing of adjective and animal, the latter of which becomes the release mascot. The tradition dates back to the first Ubuntu release in 2004 (dubbed ‘Warty Warthog’). Ubuntu 26. 🔗 Source: https://www.omgubuntu.co.uk/2026/04/ubuntu-26-10-codename-confirmed #distro#ubuntu

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