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

Резултати

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

Пребарај: #jizzakh

当前筛选 #jizzakh清除筛选
EKOLOG.UZ| ENG

@ekologuzenglish · Post #12437 · 19.04.2026 г., 04:04

#Jizzakh#Green_School 🌿 Under the Public Association “Ekolog” of Uzbekistan, the “Green School Council” of Jizzakh region organized an environmentally significant 💚 Plogging activity (picking up litter while walking or running). Coordinators and members of the council took part in the event. 📍 During the campaign, Sharof Rashidov main street and surrounding areas were cleaned of waste. Such environmental initiatives not only improve the urban environment but also play an important role in raising ecological responsibility among young people. 🔍 The main goal of the event was to increase environmental awareness among the population and to promote a sustainable lifestyle, as well as a more conscious attitude toward a clean and green environment among youth. ☘️Read the latest environmental news on the @ekologuz page. Follow us and send your suggestions and wishes via @eklguz_bot Instagram | Facebook | Twitter | Sayt | Youtube.

StartupBase

@startupbaseuz · Post #5982 · 29.07.2025 г., 11:21

🚀3 Startups Funded at “Investor Day” in Jizzakh Jizzakh hosted “Investor Day” — a platform for startups from Jizzakh, Tashkent, and Syrdarya regions to pitch their ideas directly to investors. 💡 A total of 11startups presented their projects in front of leading investors, including: AloqaVentures, IT Park Ventures, Startup Garage, Sarmo Ventures, and independent business angels. 🤝 The B2B meeting format also allowed participants to receive practical feedback from top experts: • Shahzod Narzullayev (IT Park Ventures) • Davron Parmonov (AloqaVentures) • Muhammad Khalil (Startup Garage) • Abdul Sharafiy (Sarmo Labs) 📈 Over 700 young participants attended the event — for many, it became a powerful source of inspiration. 🏆 Investment deals from AloqaVentures: • Maqsaddosh — $20,000 • Medmap — $20,000 • Mom+ — $20,000 Such regional events play a key role in building the innovation ecosystem and connecting local founders with active investors. #StartupUzbekistan#InvestorDay#Jizzakh#VentureFunding#TechEcosystem

EKOLOG.UZ| ENG

@ekologuzenglish · Post #11357 · 28.01.2026 г., 09:59

⚠️ ECOLOGICAL VIOLATIONS ARE BEING IGNORED! As of January 25, 2026, the activities of LLC “Ko‘mir Ta’minoti” of Jizzakh region, particularly the Dashtabod coal storage facility, continue to cause direct harm to local residents, while grossly violating environmental and sanitary regulations. Unfortunately, this company continues to operate without complying with basic environmental standards. Coal dust, air pollution, and the absence of protective measures have become a daily problem for the surrounding community. These violations have been reported several times on our Telegram channel. 📌 Most concerning is the fact that: Since December 2025, residents and public representatives have repeatedly submitted official complaints to the responsible authorities, yet: — no effective action has been taken, — no fines have been imposed, — no official explanations have been provided to the public. ❗️ This raises serious questions: Why are environmental violations going unpunished? Why is public health being ignored? We, as citizens and representatives of civil society, demand an urgent review of this situation and request written, official information regarding: — the identified violations, — the measures taken in response, — the fines imposed (or not imposed) on this enterprise. 🟢 Environmental protection is not a formality. 🟢 It is a matter of human health, children’s future, and the right to a clean environment. Responsible authorities must not remain silent. The public will continue to closely monitor this case. #Ecology #EnvironmentalViolations #Dashtabod #Jizzakh #PublicHealth #PublicOversight☘️Read the latest environmental news on the @ekologuz page. Follow us and send your suggestions and wishes via @eklguz_bot Instagram | Facebook | Twitter | Sayt | Youtube.

Bahodir_Schastlivchik

@bahodir_schastlivchik · Post #1894 · 08.06.2025 г., 18:11

🇺🇿🚀 BMB AGRO PLUS: ғоядан — экспортгача! Эсингизда бўлса, яқиндагина Жиззахда BMB Agro Plus — инновацион корҳонамизнинг очилиши бўлиб ўтган эди. Ушбу лойиҳа маҳсулотни шок ва акустик музлатиш технологияси асосида чуқур қайта ишлаш учун яратилган. 📦 Бугун лойиҳа амалий босқичга ўтмоқда: илк юқори технологияли музлатилган маҳсулот партияси Европага экспорт қилинди! ☝Бу — BMB Holding стратегиясининг амалдаги ифодаси: етиштириш, қайта ишлаш ва экспорт қилиш. 🇺🇿Ўзбек даласидан — 🇪🇺Европа супермаркетларининг расталаригача! Ва бу — фақатгина бошланиши. 🔹 BMB Holding — келажак сари дадил одимламоқда! #BMBHolding#BMBAgroPlus#Jizzakh#MadeInUzbekistan#UzAgroExport#АгроЭкспорт#Инновации#ШоковаяЗаморозка#AgroTech#ExportReady#AgroFuture#УзбекистанЕвропа#BMBданЕвропага @bahodir_schastlivchik