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

Резултати

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

Пребарај: #microg

当前筛选 #microg清除筛选
Libreware

@libreware · Post #1447 · 25.04.2025 г., 14:07

#microg Release v0.3.7.250923 https://github.com/microg/GmsCore/releases/tag/v0.3.7.250932 New Features and changes: Work Profile You can now sign into various work accounts that setup a work profile when using microG. As microG does not comply with all functionality imposed by organization administrators, you need to enable this feature manually in microG Settings > Work profile. Together with this comes functionality to view and install apps suggested by the organization administrator through the Play Store. Play Feature Delivery Apps can request installation of additional languages or features from split packages. You can activate this from microG Settings > Play Store Face detection This release ships with initial support for Google's Face Detection API. This functionality is still very incomplete, but works for some apps using it. Changelog Maps: Various fixes for HMS Maps (#2737, #2754, #2778, #2825). Thanks @DaVinci9196. Vision: Improve Barcode Scanning APIs (#2735, #2787). Thanks @DaVinci9196. Vision: Add initial support for face detection API (#2793). Thanks @DaVinci9196. Location: Add support for moving WiFis in Eurostar trains (#2821). Thanks @TimoWilken. Fitness: Add dummy for Recording API (#2760). Thanks @DaVinci9196. Auth: Various fixes for quick login and third-party Google sign-in (#2660, #2698, #2798). Thanks @DaVinci9196. Auth: Add support for work accounts (#2553). Thanks @fynngodau. DroidGuard: Disable access to hardware attestation. Vending: Fix handling of IAP for multi-account setups (#2681). Thanks @DaVinci9196. Vending: Add work app store (#2553). Thanks @fynngodau. Vending: Disable access to hardware keys for play integrity (#2740). Thanks @DaVinci9196 Vending: Add dummys (#2759, #2791). Thanks @DaVinci9196. Various fixes to improve support for Google Apps (#2652, #2654, #2684, #2738, #2767, #2779, #2780). Thanks @DaVinci9196. Various fixes for dynamic links (#2662), Fido (#2811), SmsRetriever API (#2786), AppSet dummy (#2781), web view handling (#2836, #2862). Thanks @DaVinci9196, @ale5000-git. Version bumps (#2813, #2829). Thanks @DaVinci9196, @ale5000-git String and location infrastructure fixes (#2693, #2755, #2781). Thanks @lucasmz-dev, @Fs00. New/Updated translations

Hashtags

Libreware

@libreware · Post #1305 · 10.07.2024 г., 00:23

FakeGAppsmicroG InstallerStableRelease(v1.6) * Updated #microG to v0.3.2.240913 * Fixed Google Maps crash * Fixed location settings crash * Uninstaller is now available * See latest microG setup here. 🏆 Thanks for @nift4 for UnifiedNLP overlay. ✅ Get it from https://fakegapps.github.io 💬 Join us @FakeGAppsChat

Hashtags

Libreware

@libreware · Post #1285 · 17.05.2024 г., 00:54

#Microg Release v0.3.2.240913 · microg/GmsCore · GitHub https://github.com/microg/GmsCore/releases/tag/v0.3.2.240913 Changelog Add support for custom location server endpoints. Improve support for sign-in to Google account in various apps and Games. Thanks @DaVinci9196 Fixes to client libraries. Thanks @rushiiMachine, @CoelacanthusHex Fix push notification sent_time delivery. Thanks @matteobtt Fix dynamic links with React Native. Thanks @derMart Fix map in Signal location sharing. Thanks @fynngodau Various other improvements and fixes. Thanks @DaVinci9196 New/Updated translations for Romanian, Brazilian Portuguese, Vietnamese, Italian, Russian, Belarusian, Spanish, Japanese, Serbian, Filipino, Swedish, Polish, Ukrainian, Dutch, Simplified Chinese. Thanks @ygorigor, @lucasmz-dev, @Fs00, @Vavun, @akir45, @nexiRS, @searinminecraft, @eson57, @rehork, @Kefir2105, @ruditimmermans, @Suwipe. Full Changelog: https://github.com/microg/GmsCore/compare/v0.3.1.240913...v0.3.2.240913

Hashtags

Libreware

@libreware · Post #1258 · 24.03.2024 г., 14:47

#microg Release v0.3.1.240913 https://github.com/microg/GmsCore/releases/tag/v0.3.1.240913 Full changelog https://github.com/microg/GmsCore/compare/v0.3.0.233515...v0.3.1.240913

Hashtags

Libreware

@libreware · Post #1148 · 30.05.2023 г., 17:05

#microg v0.2.28.231657 https://github.com/microg/GmsCore/releases/tag/v0.2.28.231657 Changelog Entirely new, rewritten location stack Major update to maps implementation. Thanks fynngodau Support for reCAPTCHA Enterprise API Various compatibility improvements Notes The new location stack does not support UnifiedNlp modules anymore. This was a step necessary to take to get locations properly working on latest Android versions. This means that some features previously available through UnifiedNlp modules do no longer exist. The goal is to merge the most important of those features into GmsCore. For now, the new locations stack is relying exclusively on Mozilla Location Service for network based location. microG GmsCore now requests a few additional privileged permissions. As always, privileged permissions are optional for microG and you can continue using microG as an unprivileged app with only minor downsides. The new privileged permissions are: android.permission.LOCATION_HARDWARE android.permission.MODIFY_PHONE_STATE android.permission.NETWORK_SCAN android.permission.UPDATE_DEVICE_STATS android.permission.WATCH_APPOPS

Hashtags

Libreware

@libreware · Post #979 · 24.09.2021 г., 15:11

Be careful for #MicroG users: Current version is NOT secure for login with your Google Account. It will show your email/password in cleartext in logcat. It doesn't matter if you have root or not, you only need logcat access to exploit it. Check the issue here https://github.com/microg/GmsCore/issues/1567

Hashtags

ReVanced Apps | MMT

@ReVanced_MMT · Post #401 · 31.05.2023 г., 18:06

MicroG Services Core Version: v0.2.28.231818 Assembled by: MMT Changelog: • bump gms version • change microG icon to MMT • apply material theme ➖➖➖➖➖➖➖➖➖ Download Links: • Universal APK • GitHub Release ➖➖➖➖➖➖➖➖➖ Join: @ReVanced_MMT Archive | Discussion #microg

Hashtags

ReVanced Apps | MMT

@ReVanced_MMT · Post #226 · 20.01.2023 г., 00:25

MicroG v0.2.27.230213 Build by OxrxL 📃Changelog: - cast bug was fixed - OxrxL re-worked MicroG for ReVanced from scratch - buffering issue faced by some users in 18.xx is fixed (source emily & oxrxl) ➖➖➖➖➖➖➖➖➖➖ 🔗 Download Link: - MicroG ARM64-v8a - MicroG Armeabi-v7a ➖➖➖➖➖➖➖➖➖➖ ReVanced Build MMT Discussion Group #microg

Hashtags

ReVanced Apps | MMT

@ReVanced_MMT · Post #215 · 18.01.2023 г., 14:19

Vanced MicroG v0.2.26.225014 Unofficial build by @inotia00 📃Changelog: // Bump GMS version to 22.50.14 // fix: Sometimes not receiving YouTube notification // fix: Dynamic colors not applied to Settings UI (Android 12+) ➖➖➖➖➖➖➖➖➖➖ 🔗 Download Link: - MicroG ARM64-v8a - MicroG Armeabi-v7a Clean installation is required ➖➖➖➖➖➖➖➖➖➖ Source Code Courtesy: @Oxrxl[Original Maintainer of Vanced MicroG] ReVanced Build MMT Discussion Group #microg

Hashtags

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