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

Резултати

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

Пребарај: #trust

当前筛选 #trust清除筛选
Илья AGI TV 🤖

@ilia_plasma · Post #221 · 16.10.2023 г., 15:14

Новый нахваленный дизайн #Trust Wallet Теперь понятно почему #TWT токен упал. Глаза немного болят 😡

Hashtags

Airdrop3 LTD

@airdrop3ltd · Post #157 · 16.07.2021 г., 17:30

DUSD NETWORK #AIRDROP#TRUST WALLET #AIRDROP#META MASK Free 🎁 200 (DUSD) Tokens Reward 🎁 for a referral 50% = 100 (DUSD) ✅Open Trust wallet ✅Go to DApps ✅Copy & Paste Airdrop link below in Dapp Search Box: 👇 Project Link : https://dusd.network/ 👇 Airdrop Link : https://dusd.network/airdrop/index.html 🔹Change network to Smart chain 🔹Click Claim Airdrop (Little $0.18 Fee Required in BNB) Listing Pancakeswap 30th October, 2021. LISTING PRICE: 1 DUSD = 0.3 USD ✅To be listed at coinmarketcap ✅Add custom token: Contract Address: 0x5eba288f8833071ba7cd5c2b356754811c0ce8fb ✅BSCSCAN https://bscscan.com/token/0x5eba288f8833071ba7cd5c2b356754811c0ce8fb ✅TELEGRAM GROUP LINK: https://t.me/dusd_network ✅Twitter LINK https://twitter.com/DusdNetwork ✅Reddit Link https://www.reddit.com/user/DUSD_Network ✅discord.com https://discord.gg/m62cgWbP ✅Youtube https://www.youtube.com/channel/UCKlGuOEocIIwIGh8V2H8DFg ✅Medium https://medium.com/@dusd.network

Mexc Dex Spread Tracker Alerts

@mexcdex · Post #24040 · 15.04.2026 г., 09:21

🟢 LONG? #TRUST Spread 8.16% detected 💥 Origin: MEXC (DUMP) [M: -10% VS D: -3%] 💎 Intuition #TRUST_USDT (COPY: TRUST) 🌐 Price DEX $0.09270 🎰 Price MEXC $0.08571 ️⚖️ Max Size: 23K $TRUST ($2K) 💹️ Funding Rate: -0.4395% 🏦 Market Cap: $16.7M 💰 Liquidity: $383K 💸 Vol DEX/MEXC: $243K / $525K ⛓️#BASE Dep: 🟢 (1800) W/d: 🟢 0x6cd905dF2Ed214b22e0d48FF17CD4200C1C6d8A3 ⏳Avg Align Time: 94s 📊Avg Spread / Max / Change: ±5% / ±5% / ±3% 📈Win / Draw / Lose: 1 / 0 / 1 💰Total / Week / 24H Profit: -0% / -3% / -3%

AI & Law

@ai_and_law · Post #96 · 28.08.2023 г., 07:04

Twilio Introduces "Nutrition Labels" to Boost Trust in AI Hello AI&Law society! Twilio, a communication tool services company, is taking a proactive step to enhance transparency and trust in its artificial intelligence services. The company is introducing "nutrition labels" for its AI models, providing information about the data used for training, the purpose of data collection, and more. The labels aim to offer users a clear understanding of how their data will be utilized. The "nutrition labels" highlight key aspects such as which AI models are being employed, whether customer data is used for training, and whether human involvement is integrated. Additionally, Twilio offers an online tool that enables other companies to generate similar labels for their AI products. Twilio's initiative aligns with broader industry efforts to ensure responsible and transparent AI practices. Salesforce, for instance, is also unveiling an acceptable use policy for its generative AI technologies, specifying prohibited practices and emphasizing responsible AI usage. #AI#Transparency#DataPrivacy#Trust#ResponsibleAI#Twilio#Salesforce

AI & Law

@ai_and_law · Post #29 · 15.06.2023 г., 07:04

Cybersecurity and AI: mapping key issues in the EU The European Union Agency for Cybersecurity (ENISA) has released a comprehensive report highlighting key cybersecurity issues in the field of artificial intelligence. The report aims to shed light on potential risks and provide guidance for policymakers, businesses, and AI developers. The report identifies several critical areas that require attention. One key concern is the security and integrity of AI systems, emphasizing the need for robust safeguards against unauthorized access, data breaches, and malicious attacks. It also highlights the importance of ensuring the privacy and protection of personal data used in AI processes. Additionally, the report emphasizes the significance of transparent and explainable AI algorithms. Clear accountability and understandable decision-making processes are vital to building trust in AI systems and avoiding potential biases or discrimination. #AI#Cybersecurity#EU#DataProtection#Privacy#Transparency#Trust#Cyberthreats

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