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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #22 · 19 јан.

Заметка начинающим, которые часто сталкиваются с подобной непоняткой. Ситуация следующая, есть список файлов: names = [ 'image.bmp', 'second.txt.bkp', 'data.db', '.config.cfg', 'file.ext.bkp' ] И мы хотим убрать у них окончание ".bkp". Не знаю зачем, пример довольно надуманный) Но суть он показывает, а это главное. Те, кто еще не очень знаком с библиотекой os.path или pathlib, вероятно решат обработать имена как строки. И тут вполне подойдет метод строки strip(). Что делает этот метод? Он отрезает указанные символы по обеим сторонам строки. Если ничего не указать, то убирает невидимые символы (пробелы, табуляции и переносы строк). В нашем случае будет выглядеть вот так: >>> name.strip('.bkp') То есть просим удалить строку '.bkp' по краям имени файла, если таковая есть. Можно применить аналогичный метод rstrip(), чтобы отрезать только справа, но для этого примера используем обычный. >>> for name in names: >>> print(name.strip('.bkp')) image.bm second.txt data.d config.cfg file.ext Хм, что-то не то с нашими именами! Что случилось??? Видим нежелательное переименование в именах, где и близко не было указанной строки '.bkp' А дело всё в том, что данный метод ищет не указанную строку, а указанные символы, и не важно в каком порядке. Для метода strip() строка '.bkp' это не паттерн для поискаа список символов. Потому он отрезал симовол 'p' от '.bmp' и удалил точку из файла '.config.cfg'. Как тогда правильно заменить именно паттерн? Для начинающего можно посоветовать метод строки replace(), который как раз использует для замены указанную строку целиком. В нашем примере заменим её на пустую строку. >>> for name in names: >>> print(name.replace('.bkp', '')) image.bmp second.txt data.db .config.cfg file.ext Уже лучше, но помните, это лишь пример про strip(). Для работы с именами файлов есть способы и более "правильные", дающие однозначно верный результат. Я взял файлы только в качестве примера. Даже replase() тут может сделать не то что ожидаем. Просто впредь будьте внимательны с этим strip(). #basic

Hashtags

Резултати

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

Пребарај: #installers

当前筛选 #installers清除筛选
Libreware

@libreware · Post #1442 · 12.04.2025 г., 14:24

microG unofficial installer Flashable zip created by ale5000 for a simple installation of #microG on Android. IT FEATURE ALSO NON-AROMA LIVE SETUP (now working on all phones). Download microG unofficial installer v1.3.2 beta - Full (Android 2.2 - 15) - MIRROR microG unofficial installer v1.3.2 beta - OSS (Android 2.2 - 15) Google sync add-on v1.2.0 beta (Android 4.4 - 4.4.4 and 7 - 8, probably even newer versions) NOTE: Devices with a MIPS CPU aren't supported. IMPORTANT: The installer isn't supported by the author of microG so installer related bugs should be reported to me instead app related bugs should be reported there. Contents See here. Official threads microG UnifiedNlp Credits MaR-V-iN (for microG, a perfect application that works perfectly also on old phones). YashdSaraf for building BusyBox (BusyBox is used only during the installation, nothing on the device is altered). Contributors ale5000 Source Code:https://github.com/micro5k Version Information Status: Beta Current Version: v1.3.2 Release Date: 2025-03-22 It is simpler to use, more compatible and already come with updated microG; also all optional apps can be disabled using live setup (using +/- volume hardware buttons). You can flash it from a custom recovery (that come pre-rooted), or from a running system with "zip-install.sh". So root is only required to install, it can be removed afterward. #installers

Libreware

@libreware · Post #1245 · 12.03.2024 г., 03:16

LineageOS adds internal support for microG https://review.lineageos.org/c/LineageOS/android_frameworks_base/+/383574 https://review.lineageos.org/q/topic:microg-eval And the application signature spoofing is locked-down to apps signed by microg.org. As of February 25th 2024, LineageOS has added internal support for application signature spoofing, a critical pre-requisite for full microG functionality. LineageOS ROM images built after that date will include this new feature. This means that many people will no longer have to root their device and install tools like Xposed/LSposed to make their ROMs compatible with microG. This is a win for both security/stability as well as user friendliness, as there is no longer any need for any settings/permissions in this implementation. The ROM will “just work” with core modules released by the microG project. Other than application signature spoofing hacks, microG installation tasks remain as before. Please see #microg#installers note for a general overview and links to recommended installation tools. ~ This is huge news for the microG project, as LineageOS is the largest and most famous custom Android ROM project in the world. LOS is also used as the foundation for a large percentage of other custom android ROMs as well. Which means that almost every one of those ROMs will also now include microG support by default, without any extra effort on their part. The impact of this on the custom ROM community cannot be overstated: it is a “watershed moment”. Many in the FOSS community have gotten increasingly frustrated with Google’s progressive crippling of the base FOSS version of android “AOSP”, and the migration of many important core functions which used to be included with AOSP into proprietary, closed-source Google apps and frameworks instead. This issue was one of the founding objectives of the microG project: give control back to the user and let them take advantage of the open-source foundation of android without forcing them to use a proprietary and snoopery vendor-locked version of the OS instead, just to get basic functionality like push messaging and Play Store app compatibility. At this point we believe that the existing “LineageOS for microG” project will continue with their project as it is a “works out of the box” solution that also bundles some FOSS app store tools.

Libreware

@libreware · Post #1247 · 12.03.2024 г., 03:16

MicroG Installers: Just installing the microg components as user apps will partially function but you will not get full functionality without the main components installed as system apps, like the location components. There are a few 3rd-party installers that handle that and set all the required permissions etc. These are the ones generally recommended *Note: currently all installers use the official microg version, so you can update it from its F-Droid repository. ♦️MicroGPlus by TheHitman https://bitgapps.io/extra.html https://t.me/MicroGPlusChat ♦️Microg installers by Ale5000 https://github.com/micro5k/microg-unofficial-installer More stuff https://github.com/micro5k/ ♦️MicroG Installer Revived.... again by spacebarred for magisk or ksu https://github.com/spacealtctrl/microg_installer_revived_again/ https://github.com/spacealtctrl/microg_installer_revived_again/releases https://t.me/microGRevivedAgainResults ♦️MinMicroG by Shane the Awesome You need to clean flash a rom that has signature spoofing support and flash this zip in recovery, choose the standard zip if unsure README: https://github.com/FriendlyNeighborhoodShane/MinMicroG/blob/master/README.md Get the latest release from here: https://github.com/FriendlyNeighborhoodShane/MinMicroG-abuse-CI/releases Or stable release from here (outdated): https://github.com/FriendlyNeighborhoodShane/MinMicroG_releases/releases ♦️microG Installer Revived by nift4 (currently outdated) README: https://github.com/nift4/microg_installer_revived#readme Download: https://github.com/nift4/microg_installer_revived/releases ♦️LineageOS for microG (Rom): https://lineage.microg.org ♦️MicroG Official links: https://microg.org https://github.com/microg https://forum.xda-developers.com/android/apps-games/app-microg-gmscore-floss-play-services-t3217616 📲MicroG official F-Droid repository (Recommended to add if you use MicroG and enable unstable updates in fdroid) https://microg.org/fdroid.html Link to add: https://microg.org/fdroid/repo?fingerprint=9BD06727E62796C0130EB6DAB39B73157451582CBD138E86C468ACC395D14165 📡@NoGoolag@Libreware #microg#install#installers#pack#links