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

Резултати

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

Пребарај: #margintrading

当前筛选 #margintrading清除筛选
SLEX NEWS

@slex_io · Post #76 · 11.08.2023 г., 12:30

🔥 Amplify Trading Potential with Margin Trading! 💹 SLEX is going to implement margin trading - your gateway to exploring tokenized assets with leverage! 📈 Trade with borrowed funds and take advantage of market movements and maximize your trading potential with our flexible margin options on SLEX platform!🚀 🌐 Join SLEX today and get $20 Welcome bonus till the official launch at 17th of August!💰 #SLEX#MarginTrading#TradingPotential#CryptoExchange Email | Telegram | Reddit | Facebook | Instagram | Medium | Linkedin | Twitter

Crypto M - Crypto News

@CryptoM · Post #64552 · 09.04.2026 г., 07:31

🚀 Binance to Introduce USDS Across Multiple Services According to the announcement from Binance, the platform is set to integrate USDS (USDS) into several of its services, including Binance Simple Earn, "Buy Crypto," Binance Convert, Binance Margin, and VIP Loan. The rollout is scheduled to commence on 2026-04-09 at 08:00 (UTC), when USDS Flexible Products and Locked Products will be available for subscription on Binance Simple Earn. In addition to the Simple Earn integration, users will have the option to purchase USDS using VISA, MasterCard, Google Pay, and Apple Pay, or trade it with their account balances on the "Buy Crypto" page. This feature will be accessible within one hour of USDS being listed on Binance Spot. Furthermore, Binance Convert will allow users to trade USDS against BTC, USDT, and other tokens without incurring any fees, also within one hour of its listing. For those interested in margin trading, Binance Margin will introduce USDS as a new borrowable asset on both Cross and Isolated Margin. The trading pairs USDS/USDT, BTC/USDS, and ETH/USDS will be available on Cross Margin starting at 2026-04-09 08:00 (UTC). Similarly, these pairs will be accessible on Portfolio Margin at the same time. Additionally, USDS will be listed as a borrowable coin on VIP Loan shortly after its spot listing. Binance advises users to exercise caution, as newly listed tokens can exhibit significant volatility. It is recommended that traders implement robust risk management strategies. For the latest information on marginable assets, users are encouraged to consult the Margin Data section. This integration marks a significant expansion of USDS's availability across Binance's diverse range of financial services. #Binance#USDS#BinanceSimpleEarn#BuyCrypto#BinanceConvert#BinanceMargin#VIPLoan#CryptoTrading#MarginTrading#SpotListing#BTC#ETH#USDT#CrossMargin#IsolatedMargin#PortfolioMargin#VISA#MasterCard#GooglePay#ApplePay#RiskManagement#CryptoVolatility#FinancialServices#CryptoAssets