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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #146 · 16 сеп.

Функция sub в regex может принимать функцию в качестве аргумента repl. 📄 Из документации: If repl is a function, it is called for every non-overlapping occurrence of pattern. The function takes a single match object argument, and returns the replacement string. То есть для каждого совпадения будет вызвана функция для вычисления замены вместо замены на одну и ту же строку для всех совпадений. Иными словами, для замены разных совпадений на разные строки не потребуется запускать re.sub() много раз для каждой строки замены. Достаточно определить функцию, которая вернёт строку для каждого из совпадений. Описание слишком запутанное🤔, давайте лучше рассмотрим на простом примере: Создаем карту замены. То есть какие строки на какие требуется менять. remap = { 'раз': '1', 'два': '2', 'три': '3', 'четыре': '4', 'пять': '5', } Пишем функцию поиска строки для замены. Единственным аргументом будет объект re.Match. Используя данные этого объекта мы вычисляем замену on-the-fly! def get_str(match: re.Match): word = match.group(1) return remap.get(word.lower()) or word Пример текста. text = '''Раз Два Три Четыре Пять Вместе будем мы считать Пять Четыре Три Два Раз Мы считать научим вас ''' Теперь запускаем re.sub и вместо строки замены (repl) подаём имя функции. (Данный паттерн ищет отдельные слова в тексте) >>> print(re.sub(r'(\w+)', get_str, text)) 1 2 3 4 5 Вместе будем мы считать 5 4 3 2 1 Мы считать научим вас Думаю, достаточно наглядно 🤓 #libs#regex

Hashtags

Резултати

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

Пребарај: #freedomtech

当前筛选 #freedomtech清除筛选
Telegram & TON NEWS

@all_telegram_ton_news · Post #23280 · 28.02.2026 г., 12:55

🍰🚀Cake Wallet v6.0.0 is HERE! The Ultimate Privacy Powerhouse Just Got a Massive Upgrade!🥳 If you care even a little about privacy, freedom, and controlling your own money, Cake Wallet is now THE MUST-HAVE app on your phone. Period. This update takes it to a whole new level – sleek new design, lightning-fast features, and tools that scream "FREEDOM!" Let's dive into why this is a game-changer for Nostr users, freedom fighters, privacy enthusiasts, and anyone tired of Big Brother watching their wallet. 🕵️‍♂️🔒 1/ First off: Monero (XMR) Mastery – Cake Wallet has always been the king of Monero. Private by default, untraceable transactions, background sync, and automatic subaddresses. Send and receive XMR without leaving a trail. If you're a freedom fighter dodging surveillance or just value anonymity, this is your shield. No KYC, no BS. Just pure privacy. 🧡#Monero 2/ Bitcoin Silent Payments: Stealth Mode Activated!🤫 Bitcoin just got a privacy glow-up. Silent Payments let you receive BTC without reusing addresses – no more linking transactions to you. Combined with Payjoin for fee-saving, privacy-preserving sends. It's like Bitcoin on steroids for discretion. Perfect for those "off-the-grid" vibes. 3/ And NOW: Bitcoin Lightning Network via Spark!⚡💥 Instant, low-fee Bitcoin transactions? Yes! Zap sats across the globe in seconds without the high on-chain costs. This is HUGE for Nostr people – seamless zaps, tips, and micropayments on your favorite decentralized social network. Freedom fighters, rejoice: Fast, cheap, and private value transfer. No more waiting for confirmations. Zap that freedom! #Nostr#BitcoinLightning 4/ Built-in Swaps: Freedom to Trade Anywhere🔄 Swap XMR, BTC, ETH, LTC, ZEC, and more right in the app – no limits, no centralized exchanges spying on you. Jupiter DEX integration for Solana swaps, cross-chain bridges, and more. Go from BTC to XMR in taps. Privacy-preserving trades that keep your business YOUR business. Oh, and it's all non-custodial. Your keys, your coins. 🗝️ 5/ Zcash Shielded Privacy + More Chains🛡️ Added full Zcash support with auto-shielding and unified addresses. Plus Arbitrum, Base, BSC for low-fee EVM fun. Multi-chain without the hassle. For freedom tech lovers, this means more tools in your arsenal against censorship. 6/ Why It's a Must-Have for Nostr Folks & Freedom Fighters🌐 Nostr runs on Bitcoin and Lightning – Cake makes it effortless. Zap posts, support creators, all while keeping your wallet private with XMR swaps. Fighting for freedom? This app is built for you: Open-source, no data collection, Tor support, hardware wallet integration (Trezor, Ledger, BitBox). Duress PIN for safety. It's not just a wallet; it's a statement. 🫡 Update NOW: iOS, Android, Desktop. Free forever. Open-source. No telemetry. Download at https://cakewallet.com/ and taste the freedom! 🥲🫥🍰 What are you waiting for? Join the privacy revolution. #CakeWallet#Privacy#FreedomTech#Crypto (Shoutout to the Cake team for non-stop innovation! Sources: Cake Wallet GitHub releases and blog for v6.0.0 details.)

Telegram & TON NEWS

@all_telegram_ton_news · Post #23230 · 24.02.2026 г., 20:50

Hey there, fellow freedom fighters! 🚀⚡ Imagine Nostr leveling up with custom NIPs that let us plug in ANY crypto we want. $XMR for ultimate privacy, $TON for seamless Telegram vibes, or whatever floats your boat. And don't forget stacking Bitcoin + Lightning Network ⚡ with Cashu ecash for that unbreakable privacy layer! This is how we build unstoppable finance, censorship-resistant social media, decentralized identity, and true non-KYC freedom tech. No more chains just pure sovereignty! Who's ready to make it happen? 🔥 Join the resistance: t.me/DanishCryptoDK | npub1c3gyzcvf2xakqy4vy06umu7hgpr97ttyp05yrlvmk8g8xvmse57qj286r6 #PrivacyMatters#Nostr#XMR#TON#Bitcoin#Lightning#Cashu#Decentralization#FreedomTech

Telegram & TON NEWS

@all_telegram_ton_news · Post #22821 · 26.01.2026 г., 20:01

Hey there, fellow freedom fighters! 🚀⚡ Imagine Nostr leveling up with custom NIPs that let us plug in ANY crypto we want. $XMR for ultimate privacy, $TON for seamless Telegram vibes, or whatever floats your boat. And don't forget stacking Bitcoin + Lightning Network ⚡ with Cashu ecash for that unbreakable privacy layer! This is how we build unstoppable finance, censorship-resistant social media, decentralized identity, and true non-KYC freedom tech. No more chains just pure sovereignty! Who's ready to make it happen? 🔥 Join the resistance: t.me/DanishCryptoDK | npub1c3gyzcvf2xakqy4vy06umu7hgpr97ttyp05yrlvmk8g8xvmse57qj286r6 #PrivacyMatters#Nostr#XMR#TON#Bitcoin#Lightning#Cashu#Decentralization#FreedomTech