@botsgram_cu · Post #4765 · 14.04.2022 г., 13:30
¿Que puede hacer este bot? @mensajesecretobot Un bot en línea para enviar mensajes secretos a uno o más destinatarios dentro de un grupo Idiomas: Español (Visto en @botsgram_cu) #mensajes
Hashtags
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
Пребарај: #mensajes
@botsgram_cu · Post #4765 · 14.04.2022 г., 13:30
¿Que puede hacer este bot? @mensajesecretobot Un bot en línea para enviar mensajes secretos a uno o más destinatarios dentro de un grupo Idiomas: Español (Visto en @botsgram_cu) #mensajes
Hashtags
@botsgram_cu · Post #4026 · 17.06.2021 г., 02:28
¿Que puede hacer este bot? @asamsgbot Este bot le permite enviar mensajes privados en chats públicos, los mensajes solo son visibles para el destinatario y el remitente. Sólo funciona de forma inline. Idiomas: español, inglés, italiano (Visto en @botsgram_cu) #mensajes#grupos
@botsgram_cu · Post #4994 · 05.05.2024 г., 03:05
¿Qué puede hacer este robot? @NoPMsBot es un creador de bots de Telegram de retroalimentación. Puedes crear un bot para organizar comentarios convenientes basados en temas en grupos . Se crea un tema separado en el grupo para cada usuario, gracias al cual puede navegar fácilmente por los diálogos y comunicarse como en un chat privado normal. Idioma: Inglés #bot#mensajes (Visto en @BotsGram_Cu)
@botsgram_cu · Post #4392 · 03.10.2021 г., 00:56
¿Que puede hacer este? @WhatsAppSaveBot Con este Bot puedes guardar textos y compartirlos directamente en WhatsApp. Idiomas: inglés italiano (Visto en @botsgram_cu) #whatsapp#mensajes
@botsgram_cu · Post #4329 · 05.09.2021 г., 11:57
¿Que puede hacer este bot? @tacitmebot Este bot puede ayudarlo a programar mensajes secretos. Idiomas: inglés (Visto en @botsgram_cu) #mensajes#anónimo
@botsgram_cu · Post #3890 · 13.05.2021 г., 03:13
¿Que puede hacer este bot? @mysterious_forwarder_bot Haga que los mensajes sean anónimos y oculte las etiquetas reenviadas. Idiomas: inglés (Visto en @botsgram_cu) #anónimo#mensajes
@botsgram_cu · Post #4661 · 07.02.2022 г., 12:36
¿Que puede hacer este bot? @CommentsBoardBot Con este bot puedes crear, editar y compartir pequeños tableros de comentarios. Idiomas: Inglés (Visto en @botsgram_cu) #mensajes#comentarios
Hashtags
@botsgram_cu · Post #3085 · 24.10.2020 г., 01:56
¿Que puede hacer este bot? @WaTgLink_Bot Un bot gratuito y de código abierto para recibir y enviar mensajes de WhatsApp directamente en Telegram, con soporte multimedia y más funciones. Idiomas: inglés (Visto en @botsgram_cu) #whatsapp#mensajes#telegram
@botsgram_cu · Post #3993 · 08.06.2021 г., 17:35
¿Que puede hacer este bot? @DelAll_XBot Puede eliminar mensajes de sus grupos / canales con filtros especiales Idioma: inglés (Visto en @botsgram_cu) #grupos#canales#herramientas#mensajes
@botsgram_cu · Post #2905 · 16.07.2020 г., 02:55
¿Que puede hacer este bot? @Anti_ServiceBot Este bot elimina cualquier mensaje de servicio en grupos. Idiomas: inglés (visto en @botsgram_cu) #mensajes#telegram#herramientas#grupos
@botsgram_cu · Post #3986 · 07.06.2021 г., 04:40
¿Que puede hacer este bot? @UUBot Crea bots de mensajería privados para que otros usuarios hablen contigo. Idiomas: español, árabe, inglés, ruso, alemán (Visto en @botsgram_cu) #bot#mensajes#programación
Hashtags
@botsgram_cu · Post #3103 · 02.11.2020 г., 18:29
¿Que puede hacer este bot? @Autoforward_Nsbot Este bot puede reenviar mensajes de un canal a otro y agregar el título automáticamente. Idioma: inglés (Visto en @botsgram_cu) #mensajes#publicaciones#canales#herramientas