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

Резултати

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

Пребарај: #atom

当前筛选 #atom清除筛选
Coin Sonar

@CoinSonar · Post #243622 · 17.04.2026 г., 11:40

#ATOM | Volume spike (USDT PAIR) 9 times the average volume 245.89K USDT traded in 15 min └Buying vol: 173.79K USDT 🟢 Boost score: 4/10 24h Vol: 2.44M USDT (Binance) Price: 1.824 (-4.0% in 24h)

Hashtags

Crypto Headlines

@market_headlines · Post #28169 · 03.04.2026 г., 09:16

🔠#ATOM Leap Wallet, криптокошелек экосистемы Cosmos, прекратит свою работу 28 мая 2026 года – анонс Ранее: DMAIL Network Crypto Headlines

Hashtags

Pro Analysis

@proanalysistrader · Post #27848 · 17.08.2024 г., 11:16

#ATOM/USDT analysis : #ATOM is currently moving up while finding support over the trendline. It has also broken out above the 200 EMA on the lower timeframes. The price is expected to continue its momentum and test previous highs. TF : 15min Entry : $4.613 Target : $4.675 SL : $4.567

Hashtags

Pro Analysis

@proanalysistrader · Post #27692 · 22.06.2024 г., 05:03

#ATOM/USDT analysis - #ATOM is in a downtrend, making new lows while trading below the 200 EMA. The price is currently rejecting from the resistance zone and expected to decline from there, continuing its bearish momentum. Aim for the previous swing low as the target level. TF : 1h Entry : $6.758 Target : $6.216 SL : $7.131

Hashtags

American Crypto©

@americancryptotrading · Post #27610 · 05.05.2026 г., 09:17

🇺🇸#ATOM/USDT is consolidating above the lowerboundary of the descendingchannel pattern on the weekly timeframe👀 Market recovery is underway🚀 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27550 · 02.03.2026 г., 11:04

🇺🇸#ATOM/USDT has found support at the lowerborder of the descendingchannel pattern on the weekly chart👨‍💻 Looks bullish🐃 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27500 · 12.01.2026 г., 10:22

🇺🇸#ATOM/USDT has bounced from the support at the lowerboundary of the descendingchannel on the weekly chart🔍 Accumulate here✈️ American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27394 · 02.10.2025 г., 09:05

🇺🇸#ATOM/USDT is facing the supportzone on the weekly chart🔍 Further upside possible after bounce🐃 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27328 · 31.07.2025 г., 10:20

🇺🇸#ATOM/USDT is testing the supportzone on the weekly chart🧐 Looking for a bounce and rally🐃 American Crypto©

Hashtags

123•••1011
ПретходнаСтраница 1 од 11Следна