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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #65 · 8 апр.

Небольшой трик с регулярными выражениями который редко вижу в чужом коде. Допустим, вам нужно распарсить простой текст и вытащить оттуда пары имя+телефон. Вернуть всё это надо в виде списка словарей. Возьмем очень простой пример текста. >>> text = ''' >>> Alex:8999123456 >>> Mike:+799987654 >>> Oleg:+344456789 >>> ''' Соответственно, для выделения нужных элементов будем использовать группы. Получится такой паттерн: (\w+):([\d+]+) Как мы будем формировать словарь из найденных групп? >>> import re >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append({ >>> "name": match.group(1), >>> "phone": match.group(2) >>> }) >>> print(results) [{'name': 'Alex', 'phone': '8999123456'}, ...] Можно немного сократить запись используя zip >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append(dict(zip(['name', 'phone'], match.groups()))) Но есть способ лучше! Это именованные группы в regex. Можно в паттерне указать имя группы и результат сразу забрать в виде словаря. >>> for match in re.finditer(r"(?P<name>\w+):(?P<phone>[\d+]+)", text): >>> results.append(match.groupdict()) То есть всё что я сделал, это добавил в начале группы (внутри сбокочек) такую запись: (?P<group-name>...) Теперь найденная группа имеет имя и можно обратиться к ней как к элементу списка >>> name = match['name'] Либо забрать сразу весь словарь методом groupdict() >>> match.groupdict() #tricks#regex

Резултати

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

Пребарај: #lunarisos

当前筛选 #lunarisos清除筛选
Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #644 · 28.06.2025 г., 12:45

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

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #623 · 25.05.2025 г., 04:37

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

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #616 · 14.05.2025 г., 18:51

Lunaris OS | Twilight - CLO | Android 15 | Nothing Phone (2) ✍️ Details: - Version: 2.11 - Released: 14/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: - Clean flash recommended from ver.2.6, dirty possible from beta builds - Recommended to use this kernel - Latest nothing firmware required - Use Ofox to flash recovery build - Device may heat up during the first dexopt 🔖Device changelog - Improve dolby dax config - Unlock additional Aperture camera frame rate - Checkout fstab from nos - Improve haptics - Improve audio - 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

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #563 · 13.02.2025 г., 10:24

Lunaris OS | Kitsune - CLO | Android 15 | Nothing Phone (2) ✍️ Details: - Version: 2.6 - Codename: #Pong - Released: 13/02/25 🔽 Download: Download | Mirror 🆘 Support : TG ⚙️ Installation: Here 📖 Changelogs: Here 📸 Screenshots : Here 🔩 Beta builds : Here 💰 Donation: BMC | steinsgate007@axl ❗️ Tags : #ROM#CLO#V#LunarisOS#NothingPhone2 ✍️ Note: - Dirty flash possible from previous build (read installation process) - Both fastboot and recovery build available - Dolby Atmos available - KSU not pre-patched, Flash Meteoric for KSU 🏆 Credits: - Nothing Phone 2 community for their support - All testers and beta users - For source and features AOSPA team, risingOS, crDroid, TenXOS etc 😎 Maintainer : @Ghosutox 🔔 Updates : @NothingPhone2Updates 💬 Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #540 · 30.01.2025 г., 05:40

Lunaris OS | Monarch - CLO | Android 15 | Nothing Phone (2) ✍️ Details: - Version: 2.5 - Codename: #Pong - Released: 29/01/25 🔽 Download: Download | Mirror 🆘 Support : TG ⚙️ Installation: Here 📖 Changelogs: Here 📸 Screenshots : Here 🔩 Beta builds : Here 💰 Donation: BMC | steinsgate007@axl ❗️ Tags : #ROM#CLO#V#LunarisOS#NothingPhone2 📚 Device changelogs: • Switch to common init • Update blobs from Pong_V3.0-250113-1723_3.0 • Improvements to performance and system stability • Update inbuild kernel ✍️ Note: - Dirty flash possible from previous build (read installation process) - Both fastboot and recovery build available - Dolby Atmos available - KSU not pre-patched, Flash Meteoric for KSU 🏆 Credits: - Nothing Phone 2 community for their support - All testers and beta users - For source and features AOSPA team, risingOS, crDroid, TenXOS etc 😎 Maintainer : @Ghosutox 🔔 Updates : @NothingPhone2Updates 💬 Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #516 · 21.01.2025 г., 06:31

Lunaris OS | Eclipse - CLO | Android 15 | Nothing Phone (2) ✍️ Details: - Version: 2.4 - Codename: #Pong - Released: 21/01/25 🔽 Download: Recovery | Fastboot | Mirror 🆘 Support : TG ⚙️ Installation: Here 📖 Changelogs: Here 📸 Screenshots : Here 🔩 Beta builds : Here 💰 Donation: BMC | steinsgate007@axl ❗️ Tags : #ROM#CLO#V#LunarisOS#NothingPhone2 ✍️ Note: - Dirty flash possible from previous build (read installation process) - Both fastboot and recovery build available - Dolby Atmos available - Recommended to flash this kernel for better experience (KSU included) 🏆 Credits: - Nothing Phone 2 community for their support - All testers and beta users - For source and features AOSPA team, risingOS, crDroid, TenXOS etc 😎 Maintainer : @Ghosutox 🔔 Updates : @NothingPhone2Updates 💬 Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #492 · 19.12.2024 г., 13:17

Lunaris OS | Eclipse - CLO | Android 15 | Nothing Phone (2) ✍️ Details: - Version: 2.3 - Codename: #Pong - Released: 19/12/24 🔽 Download: Recovery | Fastboot | Mirror 🆘 Support : TG ⚙️ Installation: Here 📖 Changelogs: Here 📸 Screenshots : Here 🔩 Beta builds : Here 💰 Donation: BMC | steinsgate007@axl ❗️ Tags : #ROM#CLO#V#LunarisOS#NothingPhone2 ✍️ Note: - Dirty flash possible from previous build (read installation process) - Both fastboot and recovery build available - Dolby Atmos available - Recommended to flash this kernel for better experience (KSU included) 🏆 Credits: - Nothing Phone 2 community for their support - All testers and beta users - For source and features AOSPA team, risingOS, crDroid, TenXOS etc 😎 Maintainer : @Ghosutox 🔔 Updates : @NothingPhone2Updates 💬 Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #477 · 27.11.2024 г., 12:14

Lunaris OS | Optimus - CLO | Android 15 | Nothing Phone (2) ✍️ Details: - Version: 2.2 - Codename: #Pong - Released: 27/11/24 🔽 Download: Recovery | Fastboot | Mirror 🆘 Support : TG ⚙️ Installation: Here 📖 Changelogs: Here 📸 Screenshots : Here 🔩 Beta builds : Here 💰 Donation: steinsgate007@axl ❗️ Tags : #ROM#CLO#V#LunarisOS#NothingPhone2 ✍️ Note: - Dirty flash possible from previous build (read installation process) - Circle to search available in both Pixel launcher and Launcher3 - Both fastboot and recovery build available - Dolby Atmos available - Recommended to flash this kernel for better experience (KSU included) 🏆 Credits: - Nothing Phone 2 community for their support - All testers and beta users - For source and features AOSPA team, risingOS, crDroid, TenXOS etc 😎 Maintainer : @Ghosutox 🔔 Updates : @NothingPhone2Updates 💬 Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #473 · 17.11.2024 г., 15:37

Lunaris OS | Ember - CLO | Android 15 | Nothing Phone (2) ✍️ Details: - Version: 2.1 - Codename: #Pong - Released: 17/11/24 🔽 Download: Recovery | Fastboot | Mirror 🆘 Support : TG ⚙️ Installation: Here 📸 Screenshots : Here 💰 Donation: steinsgate007@axl ❗️ Tags : #ROM#CLO#V#LunarisOS#NothingPhone2 ✍️ Note: - Initial public release - Both fastboot and recovery build available - Dolby Atmos available - Clean flash must (Dirty possible from previous beta) - If face You tube lag flash this kernel (KSU included) 🏆 Credits: - Nothing Phone 2 community for their support 😎 Maintainer : @Ghosutox 🔔 Updates : @NothingPhone2Updates 💬 Chat : @NothingPhone2