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

Резултати

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

Пребарај: #blast

当前筛选 #blast清除筛选
SpotOnChain | Announcement

@spotonchain · Post #629 · 28.12.2023 г., 06:04

🚨 The L2 Blast marks the big milestone with $1.1B TVL today. ➡️ Overall, 477K $ETH ($1.15B) have been deposited to #Blast and will be locked until Feb 24, 2024. ➡️ 162.5K ETH ($391M) came from the top 20 depositors, accounting for 34% of the total deposited amount. ➡️ Whale 0xd25 and 0xf73 (likely the same person) withdrew a total of 33,400 ETH ($75.2M) from Binance in the past 10 days, then deposited it into #Blast. It makes them the top 2 & 3 in depositors. 👉 More details: https://platform.spotonchain.com/en/signal-details?id=14739

Hashtags

SpotOnChain | Announcement

@spotonchain · Post #623 · 24.12.2023 г., 02:53

🔥 Whale 0xc3b deposited 5,975 $ETH ($13.8M) into @Blast_L2 ~ 1hr ago, becoming the 5th largest depositor of #Blast. - Overall, 381K $ETH ($879M) have been deposited to #Blast and will be locked until Feb 24, 2024. - Among those tokens, 129.5K $ETH ($300M), or 34% of the total deposited amount, came from the top 20 depositors. 👉 More details: https://platform.spotonchain.ai/en/signal-details/whale-withdrew-eth-from-binance-to-blast-14230

Hashtags

Web3/空投/NFT作业转发

@dddd_dddd_dddd_dddd · Post #551 · 01.03.2024 г., 05:32

#BLAST Big Bang 竞赛的获胜项目 @YOLO_Blast ,目前空投已经可以领取,但还无法转移和交易。 玩法是要通过游戏解锁 Season1,然后就能把领到的 $BOOST 烧掉,换取积分,之后可以换 $YOLO 和 $BLAST 邀请链接: https://yologames.io/?code=31548

Hashtags

Web3/空投/NFT作业转发

@dddd_dddd_dddd_dddd · Post #545 · 29.02.2024 г., 03:03

#BLAST 今天Blast_L2 主网上线,可以关注下这上面的第一个 meme coin,风险未知,看看情况再领取 https://pacmoon.io 邀请码: 455462 使用在 Blast 质押了 ETH 的钱包登录,会延续质押积分奖励。 等后续通知,猜测会给所有质押钱包发空投

Hashtags

TokenPocket

@tokenpocket_channel · Post #1250 · 01.03.2024 г., 04:50

🔔 How to create & import a [#Blast] Wallet on [#TokenPocket] Mobile Wallet or Chrome Extension Wallet? [@​Blast_L2] [@​PacmanBlur] Just 3 simple steps!🔥 Guide👇 【Details】https://twitter.com/TokenPocket_TP/status/1763426088192008326 【Powered By】Crypto Box

TokenPocket

@tokenpocket_channel · Post #1249 · 01.03.2024 г., 02:53

🆕 Blast is now live on [@​TokenPocket_TP]. [@​Blast_L2] > For both mobile wallet and Chrome Extension wallet. From now on, you can create & import & sync [#Blast] wallet on [#TokenPocket]! Tutorial👉https://help.tokenpocket.pro/en/wallet-operation/how-to-create-a-wallet/blast Get your [#Blast] Wallet on TokenPocket! 🔥🔥 👉https://www.tokenpocket.pro/ 👉https://extension.tokenpocket.pro/#/ 【Details】https://twitter.com/TokenPocket_TP/status/1763396538489856486 【Powered By】Crypto Box

Точка Деда

@tochka_deda · Post #198 · 31.07.2024 г., 19:40

🌚POV: Ты смотрел матч Virtus.рro vs. Liquid... ➡️Заряжай пари на следующую карту 👍Смотри трансляции на RLG 😎PARI Esports| #cs2#BLAST

Hashtags

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