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

Резултати

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

Пребарај: #fet

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

@proanalysistrader · Post #28270 · 27.11.2024 г., 07:56

#FET/USDT Analysis- The price has formed a symmetrical triangle pattern. Given the current bullish market scenario, there is a high probability of an upward breakout. If the breakout occurs, the price is likely to rally toward the target zone from the breakout point. T.F.- 1-D ENTRY- as soon as it gives breakout SL- 1.2 TARGET- 2.04 Note: If the stop-loss is triggered before entry, disregard the trade as the price action may develop differently.

Hashtags

Pro Analysis

@proanalysistrader · Post #27893 · 31.08.2024 г., 17:52

#FET/USDT analysis : #FET has broken down the 200 EMA and previous support levels. It is now undergoing a pullback and retesting the resistance zone. The price is expected to reject from there and bounce back to continue its bearish momentum. TF : 1H Entry : $1.170 Target : $1.057 SL : $1.252

Hashtags

American Crypto©

@americancryptotrading · Post #27518 · 29.01.2026 г., 11:04

🇺🇸#FET/USDT is facing the lowerboundary of the descendingchannel formation on the weekly chart🧐 Looks bullish✈️ American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27482 · 27.12.2025 г., 09:39

🇺🇸#FET/USDT is trading near the lowerborder of the descendingchannel formation on the 2W chart💁‍♂️ A great moment to accumulate🐃 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27370 · 10.09.2025 г., 09:48

🇺🇸#FET/USDT is trading within the descending channel formation on the 3D chart🧐 More upside if a breakout occurs📈 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27280 · 14.06.2025 г., 12:10

🇺🇸#FET/USDT is hovering above the broken s/rzone on the weekly chart🔍 Looking for a bounce✈️ American Crypto©

Hashtags

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