TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #241 · 5 мај

Можно ли в Python создавать бинарные файлы? Конечно можно. Для этого в Python есть следующие инструменты: ▫️ тип данных bytes и bytearray ▫️ открытие файла в режиме wb (write binary) или rb (read binary) ▫️ модуль struct Про модуль struct поговорим в первую очередь. Файл в формате JSON или Yaml внутри себя содержит разметку данных. Всегда можно определить где список начался а где закончился. Где записана строка а где словарь. То есть формат записи данных содержит в себе элементы разметки данных. В binary-файле данные не имеют визуальной разметки. Это просто байты, записанные один за другим. Правила записи и чтения находятся вне файла. Модуль struct как раз и помогает с организацией данных в таком файле с помощью определения форматов записи для разных частей файла. Модуль struct преобразует Python-объекты в массив байт, готовый к записи в файл и имеющий определённый вид. Для этого всегда следует указывать формат преобразования (или, как оно здесь называется - запаковки). Формат нужен для того, чтобы выделить достаточное количество байт для записи конкретного типа объекта. В последствии с помощью того же формата будет производиться чтение. При этом следует помнить что мы говорим о типах языка С а не Python. Именно формат определяет, что записано в конкретном месте файла, число, строка или что-то еще. Вот какие токены формата у нас есть. Помимо этого, первым символом можно указать порядок байтов. На разных системах одни и те же типы данных могут записываться по-разному, поэтому желательно указать конкретный способ из доступных. Если этого не сделать, то используется символ '@', то есть нативный для текущей системы. В строке формата мы пишем в каком порядке и какие типы собираемся преобразовать в байты. Запакуем в байты простое число, токен "i". >>> import struct >>> struct.pack('=i', 10) b'\n\x00\x00\x00' Теперь несколько float, при этом нужно передавать элементы не массивом а последовательностью аргументов. >>> struct.pack('=fff', 1.0, 2.5, 4.1) b'\x00\x00\x80?\x00\x00 @33\x83@' Вместо нескольких токенов можно просто указать нужное количество элементов перед одним токеном, результат будет тот же. >>> struct.pack('=3f', 1.0, 2.5, 4.1) b'\x00\x00\x80?\x00\x00 @33\x83@' Теперь запакуем разные типы >>> data = struct.pack('=fiQ', 1.0, 4, 100500) я запаковал типы float, int и unsigned long long (очень большой int, на 8 байт) b'\x00\x00\x80?\x04\x00\x00...' Распаковка происходит аналогично, но нужно указать тот же формат, который использовался при запаковке. Результат возвращается всегда в виде кортежа. >>> struct.unpack('=fiQ', data) (1.0, 4, 100500) Как видите, ничего страшного! #lib#basic

Hashtags

Резултати

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

Пребарај: #installer

当前筛选 #installer清除筛选
Libreware

@libreware · Post #1582 · 25.04.2026 г., 15:55

MicroGPlus Easy #MicroG#installer https://bitgapps.io/extra.html https://t.me/MicroGPlusChat microG is a free and open-source implementation of Google Play Services. It aims to provide a functional replacement for proprietary Google services on #Android devices. It allows users to run applications that depend on #Google Play Services.

Libreware

@libreware · Post #936 · 28.04.2021 г., 11:52

MinMicroG MicroG installer v2.10 28th april, 2021 By MOVZX and FatherJony and FriendlyNeighborhoodShane ⚠️ Check the guide called README.md inside the zips ⚠️ There's not much to update, unsurprisingly. I just wanted to make sure this thing still works. Changelog: - Update MicroG - Update AuroraSuite - Switch LocalGSM NLP backend back to the now-maintained FDroid build - Support addon.d v2 for newer A/B devices Check release notes for troubleshooting the self-check problems. ⬇️ Downloads: https://github.com/FriendlyNeighborhoodShane/MinMicroG_releases/releases/tag/2021.04.28 Build scripts and instructions: https://github.com/FriendlyNeighborhoodShane/MinMicroG 📡@NoGoolag #minmicrog#microg#installer

Libreware

@libreware · Post #1026 · 20.01.2022 г., 18:13

Anarchy-Droid One-Click Android rom installation assistant Anarchy-Droid is an application designed to help you install custom roms on your Android device. It is supposed to make the process of finding, downloading and installing a rom (with addons like F-Droid and microG) as easy as possible. The primary audience is all the folks who do not really know anything about Android, TWRP or roms, but still would like to run a free, open-source and non-bloated Android on their devices. Using a free after-market rom like LineageOS should not be restricted to the few people with enough technical know-how to do the complex installation procedure all by themselves. Anarchy-Droid is available for Windows, Mac and Linux. As of now, it should be working fine with many Samsung, OnePlus, Motorola, NVidia and Sony devices and with all other devices that already have TWRP installed. Anarchy-Droid is the successor of Free-Droid which has been fully rewritten from scratch in go. https://anarchy-droid.com https://github.com/amo13/Anarchy-Droid 📡@NoGoolag📡@Libreware #anarchydroid#rom#microg#installer

Libreware

@libreware · Post #1586 · 07.05.2026 г., 02:15

microG Installer Revived.... again by spacebarred Based on nift4's microG Installer Revived 🚀 Convert your microG to a system app for better Play Integrity results! This module promotes your installed microG to '/priv-app', where it: ✅ Gains privileged permissions like real Play Services ✅ Looks more “stock” to Play Integrity checks ✅ Gets system-level access needed for attestation ✅ More closely mimics a genuine Google Services setup • Features a fully built-in KernelSU/WebUI X interface. • Built-in downloader fetches the latest microG & Companion directly from GitHub. • Dynamically promotes whatever versions you install — no more waiting for module updates to match APKs! 📦 QUICK INSTALL 1. Flash this module via #Magisk or #KernelSU and Reboot. 2. Open the module's WebUI inside your root manager. 3. Go to the "Installer" tab to download & install microG GmsCore + Companion. 4. Go to the "Home" tab and long-press "Promote" to push them to the system level. 5. Reboot → Grant permissions in microG Settings. ✅ REQUIREMENTS • Signature spoofing enabled in your ROM • No Google services installed • Magisk v20.4+ or KernelSU • For KSU: A valid mount metamodule installed (e.g., magic mount, mountify, overlayfs) ❌ WON’T WORK ON: • Most stock ROMs (no sig spoofing support) • Devices with GApps installed 📖 Full guide & source: github.com/spacealtctrl/microg_installer_revived_again ⬇️ Downloads: https://github.com/spacealtctrl/microg_installer_revived_again/releases 🔧 Personal project — updated when possible. Join testing group: t.me/microGRevivedAgainResults #microg#installer

GitHub Trends

@githubtrending · Post #15114 · 03.09.2025 г., 07:30

#kotlin#android#apk#apks#dhizuku#installer#root#shizuku InstallerX Revived is a free, open-source Android app installer that replaces your phone’s default installer with a more powerful and customizable one. It supports many file types like apk, apks, xapk, and zip with multiple apps inside. You get features like batch installs, automatic deletion of install files, and options to block certain apps from installing. It works on Android 7 to 16 and offers a modern interface with language support. This installer improves installation speed, fixes bugs, and lets you control installation settings for a smoother, safer app installation experience. It’s community-maintained and respects your privacy. https://github.com/wxxsfxyzm/InstallerX-Revived

GitHub Trends

@githubtrending · Post #15104 · 30.08.2025 г., 12:00

#shell#alpine#alpine_linux#boot#distro#grub#installer#iso#linux#linux_distribution#liveos#netboot#netinst#netinstall#operating_systems#os#reinstall#shell_script#vps#windows You can use a powerful script to easily reinstall Linux or Windows on your server with just one command. It supports 19 popular Linux versions and all Windows versions from Vista to Windows 11, automatically downloading official ISO files and drivers. It works for switching between Linux and Windows, handles different network setups without manual IP input, and supports BIOS, EFI, and ARM servers. The script is lightweight, safe, and fetches all resources live from official sources. This saves you time and effort in system installation or reinstallation, especially on low-memory or cloud servers. You can also customize passwords, SSH keys, and ports during installation. https://github.com/bin456789/reinstall