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

Резултати

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

Пребарај: #dump

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

@spotonchain · Post #780 · 13.04.2024 г., 01:44

#FTX and #Alameda Research liquidators truly have a knack for choosing their exit points! Just 8 hours ago, they deposited another 2,500 $ETH ($8.56M) into #Coinbase at ~$3,426, right before the recent #dump! Since Mar 1, FTX and Alameda have deposited 15,850 $ETH ($58M) into CEX at ~$3,659, and dramatic price changes tended to follow afterward (see pic 👆). Follow @spotonchain and set alerts for FTX and Alameda to know as soon as they move more $ETH again now: 1. FTX 1. FTX: https://platform.spotonchain.ai/en/entity/354 2. Alameda Research: https://platform.spotonchain.ai/en/entity/79

⚠️🎱 ANON is scam. Unveiling the situation Another scam has surfaced, this time involving a project with a million-strong audience and a participant in the Open League. Background ANON started in the private 8club community for anonymous number holders, quickly raising funds in just three hours. Initially supported by Sasha P., the project gained traction with promises of utility but failed to deliver. ANON League To expand its audience, ANON launched its own league, inviting 83 channels to compete. However, after the season ended and the winners were announced, prize payments were never made. Sasha P. distanced himself, claiming he was never or anymore involved with the project. The ANON treasury was returned to him, and a DAO vote returned it to investors. Despite this, channels invested significant amounts into the league, hosting contests and creating content, with no compensation due to the missing treasury funds. More details here. Thank you all and goodbye Channels that completed tasks and invested heavily were left with unpaid rewards. Efforts to resolve the issue with the project's former and current leadership have failed. The community, including channel administrators, has contacted TON Foundation for help, but no solutions have been provided. Today, we, along with others, declare that @anon_club, @AnonEarnBot, @anonopen, @b_user, and @Mr_Domovoi are SCAMS for failing to meet their obligations, leaving many people financially deceived. If you agree with this assessment, feel free to share this post with your friends. 🩸Rest in peace ANON #TON#ANON#SCAM#Dump#RIP

Elf Crypto VIP

@elfcryptovip · Post #12659 · 11.05.2026 г., 10:34

📍 List of abbreviations commonly used in cryptocurrency trading: #ALTCOIN = Alternate cryptocurrency except bitcoin #SHITCOIN = A coin with no potential value or use #BEAR | #BEARISH = Negative price movement #BULL | #BULLISH = Positive price movement #LONG = Margin buy position #SHORT = Margin sell position #BTFD = Buy The Fucking Dip #DILDO = Long green or red candles 😆 #DYOR = Do Your Own Research #FA = Fundamental Analysis #TA = Technical Analysis #FOMO = Fear Of Missing Out #JOMO = Joy Of Missing Out #FUD = Fear Uncertainty & Doubt #HODL = Hold a position #MCAP = Market Capitalization #MOON = Continuous upward movement of price #OTC = Over The Counter #PUMP = Upward price movement #DUMP = To sell off a coin #REKT = When you have a bad loss #WHALE = Very wealthy trader/Market mover #AMA = Ask me anything #ATH = All Time High #ATL = All Time Low #DLT = Distributed ledger technology #IMO = In My Opinion #LAMBO = Lambo is symbol that becomes an elusive goal for most investors #NOOB = A person who is inexperienced #SAFU = Secure Asset Funds for Users #SHILL = Holder of altcoin who just wants to promote it for his own benefit ✅@ElfCryptoVIP