TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #65 · 8 апр.

Небольшой трик с регулярными выражениями который редко вижу в чужом коде. Допустим, вам нужно распарсить простой текст и вытащить оттуда пары имя+телефон. Вернуть всё это надо в виде списка словарей. Возьмем очень простой пример текста. >>> text = ''' >>> Alex:8999123456 >>> Mike:+799987654 >>> Oleg:+344456789 >>> ''' Соответственно, для выделения нужных элементов будем использовать группы. Получится такой паттерн: (\w+):([\d+]+) Как мы будем формировать словарь из найденных групп? >>> import re >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append({ >>> "name": match.group(1), >>> "phone": match.group(2) >>> }) >>> print(results) [{'name': 'Alex', 'phone': '8999123456'}, ...] Можно немного сократить запись используя zip >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append(dict(zip(['name', 'phone'], match.groups()))) Но есть способ лучше! Это именованные группы в regex. Можно в паттерне указать имя группы и результат сразу забрать в виде словаря. >>> for match in re.finditer(r"(?P<name>\w+):(?P<phone>[\d+]+)", text): >>> results.append(match.groupdict()) То есть всё что я сделал, это добавил в начале группы (внутри сбокочек) такую запись: (?P<group-name>...) Теперь найденная группа имеет имя и можно обратиться к ней как к элементу списка >>> name = match['name'] Либо забрать сразу весь словарь методом groupdict() >>> match.groupdict() #tricks#regex

Резултати

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

Пребарај: #auction

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

@CoinSonar · Post #243511 · 17.04.2026 г., 07:44

#AUCTION | Volume spike (USDT PAIR) 29 times the average volume 130.36K USDT traded in 15 min └Buying vol: 116.01K USDT 🟢 Boost score: 4/10 24h Vol: 430.98K USDT (Binance) Price: 4.99 (-1.9% in 24h)

Hashtags

Pro Analysis

@proanalysistrader · Post #28556 · 18.03.2025 г., 14:39

#AUCTION/USDT analysis : #AUCTION has tested the 200 EMA and rebounded from it. The price has broken out of the trendline, confirming the continuation of the bullish trend. The price is anticipated to test the swing high level. TF : 30min Entry : $33.35 Target : $37.30 SL : $30.98

Hashtags

Pro Analysis

@proanalysistrader · Post #28316 · 05.12.2024 г., 12:34

#AUCTION/USDT analysis : #AUCTION is in an uptrend, forming higher highs (HHs) and higher lows (HLs). The price has recently broken out of the trendline, indicating a potential resumption of its bullish momentum. It is anticipated that the price will continue to rise and test previous highs. TF : 30min Entry : $20.05 Target : $21.53 SL : $19.06

Hashtags

American Crypto©

@americancryptotrading · Post #27162 · 21.02.2025 г., 13:44

🇺🇸#AUCTION/USDT has printed the descending channel formation on the weekly timeframe👀 Waiting for a move up🐃 American Crypto©

Hashtags

Binance crypto champions

@binancecryptochampions · Post #3090 · 12.02.2026 г., 13:13

💎#AUCTION/USDT 💎 Signal Type: Regular (Long) Leverage: Cross (20.0x) Amount: 2.0% Entry Targets: 1) 5.040 Take-Profit Targets: 1) 5.160 2) 5.300 3) 5.600 Stop Targets: 1) 4.745 🦋 Published by: @Trading_exp🦋 Join_vip: @Crypto_Futures_Spot_Payment_bot 🚫 Don't forget to Secure profit 🚫

Hashtags

Binance crypto champions

@binancecryptochampions · Post #3060 · 02.02.2026 г., 13:00

⚡️⚡️#AUCTION/USDT⚡️⚡️ Signal Type: Regular (Long) Leverage: Cross (20x) Margin: 2.0% Entry Targets: 1) 4.40 2) 5.20 Take-Profit Targets: 1) 5.80 2) 6.20 3) 7.00 Stop Targets: 1) 4.00 🍁 Published by: @Trading_exp🍁 Join_vip: @Crypto_Futures_Spot_Payment_bot

Hashtags

Binance crypto champions

@binancecryptochampions · Post #2914 · 28.11.2025 г., 08:52

✴️Free signal-Futures ✴️ ⚡️⚡️#AUCTION/USDT⚡️⚡️ Signal Type: Regular (Long) Leverage: Cross (20x) Margin: 2.0% Entry Targets: 1) 5.20 2) 5.80 Take-Profit Targets: 1) 6.20 2) 6.40 3) 6.80 Stop Targets: 1) 4.90 🍁 Published by: @Trading_exp🍁 Join_vip: @Crypto_Futures_Spot_Payment_bot

Hashtags

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