@Dwflabs · Post #16 · 22.08.2022 г., 04:37
The future is always bright for those who can paint it with the colours of ambition, confidence, and positivity; with the right partner to support such a vision. #dwflabs#venturecapital#marketmaking
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
Пребарај: #dwflabs
@Dwflabs · Post #16 · 22.08.2022 г., 04:37
The future is always bright for those who can paint it with the colours of ambition, confidence, and positivity; with the right partner to support such a vision. #dwflabs#venturecapital#marketmaking
@Dwflabs · Post #15 · 15.08.2022 г., 07:15
The market goes up. The market goes down. In times of uncertainty, seek the right partner. The one able to guide you through the most difficult decisions. #dwflabs#venturecapital#marketmaking
@DWFLabs · Post #800 · 02.09.2024 г., 08:43
Our Business Partner of Business Development Lingling Jiang is sharing on our work and support for the space 🙌🔥 If you're around, come say hi to the team! #KSL2024#KBW2024#DWFLabs
@DWFLabs · Post #725 · 26.06.2024 г., 13:57
Could you decipher where we are? 😁 Our Business Partner of Ecosystems, Alessia Baumgartner is taking the stage soon. If you're around and would like to hear more about what we look for in projects, come join us 🔥 #Decipher2024#Algorand#DWFLabs
Hashtags
@spotonchain · Post #867 · 20.06.2024 г., 10:11
$LISTA was just listed on several exchanges with a starting price of $0.565! Note that DWF Labs (@DWFLabs) appears to be an MM of @lista_dao. In the past 2 days prior to the listing, DWF Labs received 10M $LISTA from the project and has been transferring the tokens to CEX, including: • 2.5M $LISTA to #Bitget • 2M $LISTA to #Binance • 1.5M $LISTA to #MEXC • 850K $LISTA to #Gateio • 850K $LISTA to #KuCoin Follow @spotonchain and set alerts for the #DWFLabs entity via https://platform.spotonchain.ai/en/platform/entity/122?tokens=LISTA&min_amount=1
@Dwflabs · Post #46 · 13.10.2022 г., 11:31
The Crypto Oasis Ecosystem Report 2022 for the UAE is now LIVE and DWF Labs is a part of it. Download your copy here https://t.ly/orEH #CryptoOasis#EcosystemReport#dwflabs#marketmaking#crypto