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

Резултати

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

Пребарај: #zahahadid

当前筛选 #zahahadid清除筛选

BEEAH Headquarters / Zaha Hadid Architects BEEAH Group's new headquarters in Sharjah, UAE, was opened on Wednesday, March 30 by His Highness Dr. Sheikh Sultan bin Muhammad Al Qasimi, Ruler of Sharjah. Powered by its solar array and equipped with next-generation technologies for operations at LEED Platinum standards, the new headquarters has been designed by Zaha Hadid Architects (ZHA) to achieve net-zero emissions and will be the group’s management and administrative centre that sets a new benchmark for future workplaces. #arch_shovel#architecture#archdaily#zahahadid

Zaha Hadid Architects wins competition to design the new Hangzhou International Sports Centre. Incorporating a 60,000-seat football stadium and practice pitches, the centre also includes a 19,000-seat indoor arena as well as an aquatics centre with two 50-metre pools. The centre establishes a new riverfront park and public plazas with direct access to Lines 3 and 5 of the city’s expanding metro network. Located within the warm temperate climate of Hangzhou, the International Sports Centre has been designed to the highest 3-Star rating of China’s Green Building Program with each venue providing optimal conditions using natural hybrid ventilation most of the year. Annual solar irradiation analysis has determined the composition of the façade’s external louvres while photovoltaics will harvest solar power for all venues. Ground heat exchange and recovery systems will ensure the most efficient operations of all facilities. #architecture#zahahadid#arch_shovel#archdaily

KAPSARC awarded five LEED EBOM Platinum certifications by the US Green Building Council . The only buildings in Saudi Arabia to receive Platinum LEED Existing Building: Operation & Maintenance (EBOM) certification, KAPSARC’s five community facilities achieved the highest sustainability standards throughout the centre’s design, construction, operations and maintenance procedures. . KAPSARC’s waste management program diverted 94% of solid waste from landfill through waste stream audits that eliminated single-use goods and developed an effective waste segregation strategy across multiple stages. KAPSARC also reduced the compound’s water consumption by 30% with weather-based micro-irrigation, mulching, native planting and efficient faucets. The centre’s energy usage was also reduced by 35% with energy audits regularly identifing energy conservation measures. . #architecture#zahahadid#zahahadidarchitects#architecture#arch_shovel#archidaily

Parametric Architecture. Works by Mariana Cabugueira ( a Senior Architectural Designer at Zaha Hadid Architects): 1 – the Concert Hall. 2 - Tower C - the Zaha Hadid tower. 3-6 – A Mega Luxury Hotel and Office Hybrid Tower. 7-8 – The Floating Park Island. 9-10 – the Mykonos Villa. #arch_shovel#architecture#parametric#maya#zahahadid

Штаб Зюзино

@zuzinoshtab · Post #432 · 01.10.2020 г., 15:00

👆🏿❗️Муниципальный депутат Зюзино Юрий Самгин побеседовал с исполнительным директором архитектурного бюро Zaha Hadid Кристосом Пассосом. Это архбюро разрабатывало концепцию застройки Кузьминок – «столицы реновации», как окрестили район столичные власти. 👉🏿Рекомендуем к просмотру: https://youtu.be/jdqerALE5OM Кстати, вот интервью с господином Пассосом от ноября 2017 г. #конкурс#москомархитектура#кузнецов#самгин#zahahadid#кузьминки