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

Резултати

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

Пребарај: #powr

当前筛选 #powr清除筛选
Pro Analysis

@proanalysistrader · Post #28382 · 11.01.2025 г., 13:30

#POWR/USDT analysis : #POWR has successfully broken above the trendline and is anticipated to continue its upward movement, with the potential to test previous highs. This breakout signals a bullish trend, suggesting further price appreciation in the near term. TF : 1D Entry : $0.3090 Target : $0.4500 SL : $0.2270

Hashtags

Pro Analysis

@proanalysistrader · Post #28307 · 04.12.2024 г., 08:45

#POWR/USDT analysis : #POWR is currently in an uptrend, trading above the 200 EMA. The price has bounced back from the support zone with strong volume. As a result, we can expect the price to maintain its bullish momentum and test higher levels. TF : 2H Entry : $0.3500 Target : $0.4200 SL : $0.3022

Hashtags

Pro Analysis

@proanalysistrader · Post #27824 · 09.08.2024 г., 17:35

#POWR/USDT analysis : #POWR is in a correction phase and has recently tested the resistance zone near the 200 EMA. The price is anticipated to be rejected from there and continue its downward direction. Wait for the break of the $0.1936 level for entry. TF : 4H Entry : $0.1936 Target : $0.1751 SL : $0.2058

Hashtags

Crypto Australia🇭🇲🇭🇲

@CryptoAustralia · Post #15811 · 13.02.2024 г., 14:43

⚡️⚡️#POWR/USDT ⚡️⚡️ Exchanges: Binance Futures Signal Type: Regular (Long) Leverage: Cross (50х) Entry Targets: 0.3596 Take-Profit Targets: 1)0.365 2)0.3686 3)0.3722 4)0.3776 5)0.3812 6)0.3866 7) 🚀🚀🚀 Stop Targets: 5-10% By Crypto Australia

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #9037 · 28.07.2024 г., 07:15

#POWR👈 https://www.binance.com/en/trade/POWR_BTC Buy at current 320-335 Highly pumpable Coin on the brink of 🚀 Buy in parts 👈strictly follow for max profits as its pump coin Sell 🤑360-380 🤑380-410 🤑 410-440 🤑 440-470 🚀 470- 500 & above Bullish above -300

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #9016 · 12.05.2024 г., 12:05

#POWR👈 https://www.binance.com/en/trade/POWR_BTC Buy at current 485-495 Highly pumpable Coin on the brink of 🚀 Buy in parts 👈strictly follow for max profits as its pump coin Sell 🤑520-550 🤑 550-600 🤑 600-650 🤑 650-700 🚀 700- 750 & above Bullish above -470

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #8850 · 16.09.2023 г., 17:59

#POWR👈 https://www.binance.com/en/trade/POWR_BTC Buy at current 525-540 Highly pumpable Coin on the brink of 🚀 Buy in parts 👈strictly follow for max profits as its pump coin Sell 🤑 570-600 🤑 600-650 🤑 650-700 🚀 700- 750 & above Bullish above -510

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #8797 · 19.05.2023 г., 16:40

#POWR👈 https://www.binance.com/en/trade/POWR_BTC Buy at current 605-610 Highly pumpable Coin on the brink of 🚀 Buy in parts 👈strictly follow for max profits as its pump coin Sell 🤑 640-670 🤑 670-730 🤑 730-790 🚀 790- 850 & above Stop Loss/Exit -590

Hashtags

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