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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #146 · 16 сеп.

Функция sub в regex может принимать функцию в качестве аргумента repl. 📄 Из документации: If repl is a function, it is called for every non-overlapping occurrence of pattern. The function takes a single match object argument, and returns the replacement string. То есть для каждого совпадения будет вызвана функция для вычисления замены вместо замены на одну и ту же строку для всех совпадений. Иными словами, для замены разных совпадений на разные строки не потребуется запускать re.sub() много раз для каждой строки замены. Достаточно определить функцию, которая вернёт строку для каждого из совпадений. Описание слишком запутанное🤔, давайте лучше рассмотрим на простом примере: Создаем карту замены. То есть какие строки на какие требуется менять. remap = { 'раз': '1', 'два': '2', 'три': '3', 'четыре': '4', 'пять': '5', } Пишем функцию поиска строки для замены. Единственным аргументом будет объект re.Match. Используя данные этого объекта мы вычисляем замену on-the-fly! def get_str(match: re.Match): word = match.group(1) return remap.get(word.lower()) or word Пример текста. text = '''Раз Два Три Четыре Пять Вместе будем мы считать Пять Четыре Три Два Раз Мы считать научим вас ''' Теперь запускаем re.sub и вместо строки замены (repl) подаём имя функции. (Данный паттерн ищет отдельные слова в тексте) >>> print(re.sub(r'(\w+)', get_str, text)) 1 2 3 4 5 Вместе будем мы считать 5 4 3 2 1 Мы считать научим вас Думаю, достаточно наглядно 🤓 #libs#regex

Hashtags

Резултати

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

Пребарај: #webui

当前筛选 #webui清除筛选

#Clash#ClashMeta#WebUI#metacubexd#Yacd GH 页面自定义域:http://d.metacubex.one GH 页面:https://metacubex.github.io/metacubexd Cloudflare 页面:https://metacubexd.pages.dev 省流(个人认为体验优于Yacd): - 在Connections的功能相当丰富,功能体验最优(无法全部显示时,Shift+滚轮 可以横向滚动) - Proxies界面节点延迟可视化显示 - 还有一些其他Web UI所没有的功能 来源(ClashMeta官方支持)

GitHub Trends

@githubtrending · Post #14906 · 03.07.2025 г., 13:00

#typescript#ai#anthropic#artifacts#assistant_api#aws#azure#chatgpt#chatgpt_clone#claude#clone#dall_e_3#deepseek#gemini#google#librechat#o1#openai#plugins#vision#webui LibreChat is a free, open-source AI chatbot platform that lets you use many AI models like OpenAI, Anthropic, and AWS in one place. It offers advanced features such as secure code execution in multiple programming languages, AI assistants that can handle files and tools without coding, and the ability to generate images and diagrams directly in chat. You can search conversations easily, manage multiple chat threads, and customize the interface to fit your needs. LibreChat supports multiple languages, speech input/output, and secure multi-user access. It can be deployed locally or on the cloud, giving you flexibility and control over your AI experience. This means you get a powerful, customizable AI assistant without needing to pay for ChatGPT Plus or rely on a single provider[1][3][5]. https://github.com/danny-avila/LibreChat

GitHub Trends

@githubtrending · Post #15418 · 16.01.2026 г., 12:00

#typescript#acp#ai#ai_agent#banana#chat#chatbot#claude_code#codex#cowork#excel#gemini#gemini_cli#gemini_pro#llm#multi_agent#nano_banana#office#qwen_code#skills#webui AionUi is a free, open-source app that gives your CLI AI tools like Gemini CLI, Claude Code, and Qwen Code a simple graphical interface on macOS, Windows, or Linux. It auto-detects them for easy chatting, saves talks locally with multi-sessions, organizes files smartly, previews 9+ formats like PDF or code instantly, generates/editing images, and offers web access. You benefit by ditching complex commands for quick, secure AI help in office tasks, coding, or data work—saving time and boosting productivity without data leaving your device. https://github.com/iOfficeAI/AionUi

BotsGram®

@botsgram_cu · Post #3169 · 25.11.2020 г., 16:40

@channely_bot Qué puede hacer este bot? Este bot es el mejor asistente para la gestión de canales en Telegram. Conecto los canales al servicio principal. ¡Incluyendo un rico entorno webUI de edición! https://app.channely.co/ Idioma: Inglés (visto en @BotsGram.cu) #canales, #canal, #gestión, # administración, #richeditor, #posts, #schedule, #polls, #comment, #commenting, #reactions, #editor, #share, #buttons, #webui, #subscribe, #stats, #users, #trial, #limited, #proaccount