Заметка начинающим, которые часто сталкиваются с подобной непоняткой.
Ситуация следующая, есть список файлов:
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
Derpfest - Official | Android 16 QPR2| Nothing Phone 2
✍️ Details:
- Codename: #Pong
- Released: 26-03-2026
🔽 Download : Here | Mirror
✨ Changelogs: Here
🆘 Support: Here
📸 Screenshots: Here
💰 Donate: Here | Here
🏷 Tags : #ROM#AOSP#Official#Derpfest#NothingPhone2
✍️ Notes:
• Gapps is included. Do NOT flash again.
• Latest base firmware is recommended.
• If you face any bugs, report with logs.
• NTcamera and dolby support available.
• KSU included
🏆 Credits:
- DerpFest Team
- Testers who helped all throughout
- @genoxci for the banner!
-@AgarwalGovind for the build server!
👤 Maintainers: @NeiKos4962
🔔 Updates: @NothingPhone2Updates
💬 Chat: @NothingPhone2
Derpfest - Official | Android 16 QPR2| Nothing Phone 2
✍️ Details:
- Codename: #Pong
- Released: 01-02-2026
🔽 Download : Here
✨ Changelogs: Here
🆘 Support: Here
📸 Screenshots: Here
💰 Donate: Here | Here
🏷 Tags : #ROM#AOSP#Official#Derpfest#NothingPhone2
✍️ Notes:
• Gapps is included. Do NOT flash again.
• Latest base firmware is recommended.
• If you face any bugs, report with logs.
• NTcamera and dolby support available.
• KSU-Next with SuSFS included
• CLEAN FLASH MANDATORY
🏆 Credits:
- DerpFest Team
- Testers who helped all throughout
- @genoxci for the banner!
👤 Maintainers: @NeiKos4962
🔔 Updates: @NothingPhone2Updates
💬 Chat: @NothingPhone2
Derpfest - Official | Android 16| Nothing Phone 2
✍️ Details:
- Codename: #Pong
- Released: 19-10-2025
🔽 Download : Here | Mirror
✨ Changelogs: Here
🆘 Support: Here
📸 Screenshots: Here
💰 Donate: Here | Here
🏷 Tags : #ROM#AOSP#Official#Derpfest#NothingPhone2
✍️ Notes:
• Gapps is included. Do NOT flash again.
• Latest base firmware is recommended.
• If you face any bugs, report with logs.
• NTcamera and dolby support available.
• KSU-Next with SuSFS included
🏆 Credits:
- DerpFest Team
- Testers who helped all throughout
- @genoxci for the banner!
👤 Maintainers: @NeiKos4962
🔔 Updates: @NothingPhone2Updates
💬 Chat: @NothingPhone2
Derpfest - Official | Android 16| Nothing Phone 2
✍️ Details:
- Codename: #Pong
- Released: 18-09-2025
🔽 Download : Here | Mirror
✨ Changelogs: Here
🆘 Support: Here
📸 Screenshots: Here
💰 Donate: Here | Here
🏷 Tags : #ROM#AOSP#Official#Derpfest#NothingPhone2
✍️ Notes:
• Gapps is included. Do NOT flash again.
• Latest base firmware is recommended.
• If you face any bugs, report with logs.
• NTcamera and dolby support available.
• KSU-Next with SuSFS included
🏆 Credits:
- DerpFest Team
- Testers who helped all throughout
- @genoxci for the banner!
👤 Maintainers: @NeiKos4962
🔔 Updates: @NothingPhone2Updates
💬 Chat: @NothingPhone2
NothingMuchROM | Android 14 | Nothing Phone (2)
Nothing OS with some handful modifications for a better experience
✍️ Details:
- Version: r15 (NOS 2.6.0)
- Codename: #Pong
- Released: 08/07/24
🔽 Download : Here
🆘 Support group: TG | XDA
⚙️ Installation: Here
🔖Tags : #Stock#ROM#arter97#U#NothingPhone2
✨Changelogs:
- Stable release based on 2.6.0
- Custom bionic updated to use the latest AOSP compiler and fix several minor issues in the math library.
😎 Developer: @arter97
🔔 Updates: @NothingPhone2Updates
💬 Chat: @NothingPhone2
NothingMuchROM | Android 14 | Nothing Phone (2)
Nothing OS with some handful modifications for a better experience
✍️ Details:
- Version: r14 (NOS 2.5.6)
- Codename: #Pong
- Released: 02/07/24
🔽 Download : Here
🆘 Support group: TG | XDA
⚙️ Installation: Here
🔖Tags : #Stock#ROM#arter97#U#NothingPhone2
✨Changelogs:
- Stable release based on NOS 2.5.6
- Dirac is back, thanks to the fix from gotenksIN
✍️ Note:
- If you don't want dirac, stick to the r13 build based on NOS 2.5.6
😎 Developer: @arter97
🔔 Updates: @NothingPhone2Updates
💬 Chat: @NothingPhone2
Meteoric Kernel | Android 14 | Nothing Phone (2)
✍️Details
- Version: r4.2
- Codename: #Pong
- Released: 14/07/24
🔽Download: [ Normal | KSU ] Version
🆘Support Threads: TG
🎄Source: Here
🔖Tags: #Meteoric#Kernel#U#NothingPhone2
✨Changelogs
- Lockscreen does not dim now when user is using hbm.
- Optimize fingerprint on custom roms.
- Fix compatibility with AOSPA.
✍️Note
- Report issues (if any) with logs in the support group or comment section below.
- You can revert back to stock kernel (state) by flashing stock boot, vendor_boot and dtbo image
- This kernel is compatible with both NOS & custom ROM(s)
😎Dev: @HELLBOY017
🔔Updates: @NothingPhone2Updates
💬Chat: @NothingPhone2
Meteoric Kernel | Android 14 | Nothing Phone (2)
✍️Details
- Version: r4.1
- Codename: #Pong
- Released: 03/07/24
🔽Download: [ Normal | KSU ] Version
🆘Support Threads: TG
🎄Source: Here
🔖Tags: #Meteoric#Kernel#U#NothingPhone2
✨Changelogs
- Fix cpu_input_boost driver not detecting idle state (Improves battery drain)
- Thermal driver optimizations from motorola
- Fingerprint improvement for custom roms
- Switch back to qcom-lpm idle governor
- Merged latest clo tags and sync with android12-5.10-lts
- Reconfigure cpu_input_boost freqs
- Fix kcal not applying
- Fix crashdump caused due to gpu not waking up
✍️Note
- Report issues (if any) with logs in the support group or comment section below.
- You can revert back to stock kernel (state) by flashing stock boot, vendor_boot and dtbo image
- This kernel is compatible with both NOS & custom ROM(s)
😎Dev: @HELLBOY017
🔔Updates: @NothingPhone2Updates
💬Chat: @NothingPhone2
Lunaris OS | CLO | Android 15 | Nothing Phone (2)
✍️ Details:
- Version: 2.13
- Released: 28/06/25
🔽 Download: Here
🆘 Support : TG
⚙️ Installation: Here
📓 Kernel: Here
📸 Screenshots : Here
🔩 Beta builds : Here
💰 Donation: BMC | steinsgate007@axl
❗️ Tags : #ROM#CLO#V#LunarisOS#NothingPhone2
✍️ Note:
- Recommended to use this kernel
- Dolby and nothing camera support available
- Latest nothing firmware required
- Found bugs! Report in group with proper logs
🔖 Changelog
- Merged System LA.QSSI.15.0.r1-16100 (June Patch)
- Add Per-app refresh rate selector
- Add keybox spoofing (Thanks to HELLBOY017)
- Add LMO SystemClocks
- Forcefully enable hotspot speed settings
- Add support for omni statusbar weather logo
- Improvements to performance and system stability
🏆 Credits:
- Nothing Phone 2 community for their support
- All testers and beta users
- For source and features AOSPA team, axionAOSP, risingOS, TenXOS etc
😎 Maintainer : @Ghosutox
🔔 Updates : @NothingPhone2Updates
💬 Chat : @NothingPhone2
Lunaris OS | Radahn - CLO | Android 15 | Nothing Phone (2)
✍️ Details:
- Version: 2.12
- Released: 25/05/25
🔽 Download: Recovery | Fastboot | Mirror
🆘 Support : TG
⚙️ Installation: Here
📓 Kernel: Here
📸 Screenshots : Here
🔩 Beta builds : Here
💰 Donation: BMC | steinsgate007@axl
❗️ Tags : #ROM#CLO#V#LunarisOS#NothingPhone2
✍️ Note:
- Recommended to use this kernel
- Latest nothing firmware required
- Found bugs! Report in group with proper logs
🔖 Changelog
- Add back NOS camera sepolicy
- Merged System LA.QSSI.15.0.r1-15600-qssi.0
- Configurable Nothing OS inspired doze animation
- Add experimental SDK 32 play store spoof switch for integrity
- Switch to adreno-t drivers
- Some bugs and NPE fixes
- Improvements to performance and system stability
🏆 Credits:
- Nothing Phone 2 community for their support
- All testers and beta users
- For source and features AOSPA team, axionAOSP, risingOS, TenXOS etc
😎 Maintainer : @Ghosutox
🔔 Updates : @NothingPhone2Updates
💬 Chat : @NothingPhone2