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

Резултати

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

Пребарај: #super

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

@proanalysistrader · Post #28573 · 22.03.2025 г., 15:20

#SUPER/USDT analysis : #SUPER is consolidating within a support and resistance zone. The price has bounced off the support zone and is anticipated to target the old swing high resistance level. TF : 4h Entry : $0.4515 Target : $0.4920 SL : $0.4280

Hashtags

Pro Analysis

@proanalysistrader · Post #28360 · 01.01.2025 г., 14:00

#SUPER/USDT analysis : #SUPER is currently in a downtrend, trading below the 200 EMA. The price is in an impulsive phase, and it is expected to retrace before continuing its bearish momentum. Wait for the price to test the designated zone for potential short entry. TF : 2h Entry : $1.4930 Target : $1.2390 SL : $1.5930

Hashtags

Pro Analysis

@proanalysistrader · Post #28222 · 18.11.2024 г., 16:20

#SUPER/USDT analysis : #SUPER is currently in an uptrend, trading above the 200 EMA. The price has broken out of the trendline and is expected to continue its bullish momentum, with the potential to test the previous swing high. For a long entry, it is advisable to wait for a breakout above the $1.3870 level. TF : 4h Entry : $1.3870 Target : $1.5900 SL : $1.2590

Hashtags

Pro Analysis

@proanalysistrader · Post #28030 · 17.10.2024 г., 12:55

#SUPER/USDT analysis- The price formed cup and handle pattern and if it gives breakout then it has potential to up till the ATH. T.F.-1-W ENTRY- as soon as it gives breakout i.e. 1.45-1.46 SL- below the breakout candle TARGET- 4.77

Hashtags

Pro Analysis

@proanalysistrader · Post #27954 · 23.09.2024 г., 09:36

#SUPER/USDT analysis : #SUPER is in an uptrend trading above 200ema. Price is expected to continue its bullish momentum. For long entry, wait for retracement till support zone. As recent swing high will be target level. TF : 1h Entry : $0.8970 Target : $0.9610 SL : $0.8614

Hashtags

American Crypto©

@americancryptotrading · Post #27186 · 16.03.2025 г., 14:31

🇺🇸#SUPER/USDT has retested the s/rzone on the weekly timeframe🔥 Waiting for more upside📈 American Crypto©

Hashtags

Crypto Angels

@cryptoangelsusa · Post #22077 · 27.11.2025 г., 09:49

Binance Futures, ByBit USDT, Bitget Futures, KuCoin Futures, OKX Futures #SUPER/USDT All take-profit targets achieved 😎 Profit: 76.4797% 📈 Period: 1 Hours 0 Minutes ⏰

Hashtags

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