@inPDF · Post #7269 · 22.02.2026 г., 12:00
#Wanderlust🇬🇧 UK February-March 2026 #geo ⤵️@inPDF📬
Hashtags
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
Пребарај: #wanderlust
@inPDF · Post #7269 · 22.02.2026 г., 12:00
#Wanderlust🇬🇧 UK February-March 2026 #geo ⤵️@inPDF📬
Hashtags
@inPDF · Post #6860 · 02.11.2025 г., 16:12
#Wanderlust🇬🇧 UK October-November 2025 #geo ⤵️@inPDF📬
Hashtags
@inPDF · Post #6767 · 28.09.2025 г., 17:32
#Wanderlust🇬🇧 UK August-September 2025 #geo ⤵️@inPDF📬
Hashtags
@inPDF · Post #6551 · 01.03.2025 г., 20:14
#Wanderlust🇬🇧 UK February-March 2025 #geo ⤵️@inPDF📬
Hashtags
@inpdf · Post #7594 · 22.04.2026 г., 14:41
#Wanderlust🇬🇧 UK April-May 2026 #geo ⤵️@inPDF📬
Hashtags
@inpdf · Post #6226 · 06.11.2024 г., 16:57
#Wanderlust🇬🇧 UK October-November 2024 #geo ⤵️@inPDF📬
Hashtags
@inpdf · Post #5905 · 28.10.2023 г., 19:23
#Wanderlust🇬🇧 UK October-November 2023 #geo ⤵️@inPDF📬
Hashtags
@inpdf · Post #5729 · 31.08.2023 г., 17:04
#Wanderlust🇬🇧 UK August-September 2023 #geo ⤵️@inPDF📬
Hashtags
@internationalgeographic · Post #5600 · 14.04.2025 г., 03:56
📍 Nighttime in Singapore 🇸🇬 View of the Marina Bay Sands hotel 🌆 Singapore is an island nation in Southeast Asia. Founded as a British trading colony in 1819, after gaining independence it became one of the most prosperous countries, with the world's leading trading port. A fascinating fact: Singapore is the world's only island city-state! 🏙️🌴 #travel#wanderlust#cityscape
Hashtags
@veonadtech · Post #254 · 11.07.2025 г., 10:30
Ловим момент, когда мозг говорит: «Пора в отпуск!» Мечты рождаются между делом: 🫴 Оплатил связь → увидел билеты по цене кофе 👍 Оформил страховку → получил оффер на SPA-уикенд 🛫 Проверил баланс → открыл подборку тревел-хаков Почему это не реклама, а магия: ✨ Алгоритм ловит момент, когда мозг готов к побегу ✈️ Предложения встраиваются в рутину, как свои мысли 📈 Конверсия в 4 раза выше стандартных баннеров P.S. Это как если бы Booking.com читал мысли — только точнее и без cookie. 💻 Знаем, как продавать отдых до того, как его захотят — протестируем? #VEONAds#BehavioralTargeting#DigitalMarketing#Wanderlust#TravelTech#SmartAds 👋👋Всё о digital-рекламе в Узбекистане: аналитика, лайфхаки и готовые решения.
@amazingworldtravel · Post #677 · 10.04.2026 г., 03:58
🇲🇬Avenue of the Baobabs, Madagascar Ancient baobab trees, some over 800 years old and 30 meters tall, line this red-dirt road in western Madagascar like sentinels from a primordial world. These Grandidier's baobabs are among the most endangered trees on Earth — the last survivors of a once-dense tropical forest cleared over centuries, leaving these ancient giants standing alone in open farmland. At sunset, their massive silhouettes glow against a sky of liquid fire, bare branches reaching upward like roots — which is why Malagasy legend says the gods planted baobabs upside down. Ox-carts pass between trees that were already ancient when Genghis Khan rode across Asia, creating one of Africa's most hauntingly beautiful landscapes. Drop a 🔥 if this is on your list! #travel#wanderlust#explore#bucketlist#travelgram#adventure 📸@amazingworldtravel
@amazingworldtravel · Post #675 · 09.04.2026 г., 03:45
🇺🇸Antelope Canyon, United States Sculpted by flash floods over millions of years, this narrow slot canyon in Navajo Nation reveals flowing sandstone walls in waves of orange, red, purple, and gold. When midday sunlight beams pierce the narrow openings above, shafts of light illuminate the swirling rock in an ever-changing display that has made Antelope Canyon one of the most photographed wonders in the American Southwest. Upper Antelope Canyon — 'the place where water runs through rocks' in Navajo — is a smooth, undulating corridor at ground level, while Lower Antelope Canyon descends via narrow ladders into deeper chambers. Both were formed by monsoon floods that carry sand polishing the Navajo sandstone into these impossibly smooth, flowing forms. Drop a 🔥 if this is on your list! #travel#wanderlust#explore#bucketlist#travelgram#adventure 📸@amazingworldtravel