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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #76 · 27 апр.

Ранее я делал серию постов про битовые операторы. Вот вам ещё один наглядный пример как это используется в Python в модуле re. Чтобы указать флаг для компилятора нам надо указать его после передаваемой строки. Например, добавляем флаг для игнорирования переноса строки. pattern = re.compile(r"(\w+)+") words = pattern.search(text, re.DOTALL) А как указать несколько флагов? Ведь явно будут ситуации когда нам потребуется больше одного. Кто читал посты по битовые операторы уже понял как. pattern.search(text, re.DOTALL | re.VERBOSE) А теперь смотрим исходники, что находится в этих атрибутах? Не удивительно, степени двойки. Почему? Потому что каждое следующее значение это сдвиг единицы влево. >>> for n in [1, 2, 4, 8, 16, 32, 64, 128, 256]: >>> print(bin(n)) 0b1 0b10 0b100 0b1000 0b10000 0b100000 0b1000000 0b10000000 0b100000000 Чтобы было понятней, давайте напишем тоже самое но иначе, добавим ведущие нули: 000000001 000000010 000000100 000001000 000010000 000100000 001000000 010000000 100000000 Не понятно что тут происходит? Читай три поста про битовые операторы начиная с этого ➡️https://t.me/pythonotes/45 В общем, это пример применения побитовых операций в самом Python. Теперь вы знаете Python еще немного лучше) #tricks#regex#libs

Резултати

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

Пребарај: #coha

当前筛选 #coha清除筛选
Addis Standard

@addisstandardeng · Post #21247 · 30.01.2026 г., 09:14

News: #AU Chairperson calls for maximum restraint amid renewed tensions in #Tigray The Chairperson of the African Union Commission, Mahmoud Ali Youssouf, has urged all parties in #Ethiopia’s Tigray region to exercise maximum restraint as tensions rise and reports emerge of renewed clashes in parts of the region. In a statement issued on Friday, the AU Commission said its Chairperson is closely monitoring developments in Tigray and expressed deep concern over recent developments. He re-emphasized the paramount importance of preserving the “hard-won gains” achieved under the African Union-led Permanent Cessation of Hostilities Agreement (#COHA) signed between the federal government and the Tigray People’s Liberation Front (#TPLF) in Pretoria on 2 November 2022. The Chairperson called on all parties to refrain from actions that could undermine confidence and to resolve outstanding issues through constructive dialogue, in full adherence to both the ..... Read more: https://addisstandard.com/?p=54840

Addis Standard

@addisstandardeng · Post #21310 · 04.02.2026 г., 15:20

News: #AU monitoring team returns to #Mekelle after tensions renew focus on #Pretoria agreement An advance team of African experts under the African Union’s Monitoring, Verification and Compliance Mechanism (#AU-MVCM) has arrived in Mekelle, resuming its “mandate of monitoring the implementation” of the Permanent Cessation of Hostilities Agreement (#COHA), the AU Commission’s Political Affairs, Peace and Security Department said on today. According to the Commission, the team redeployed after an “administrative break” to resume their mandate the office said was “crucial” to the implementation of the of the COHA, signed between the federal government and the #Tigray People’s Liberation Front (#TPLF) in November 2022. The resumption of the task comes amid concerns over renewed tensions, clashes and drone strikes in parts of Tigray. Last week, the AU Commission Chairperson Mahmoud Ali Youssouf .... Read more: https://addisstandard.com/?p=54994

Addis Standard

@addisstandardeng · Post #21388 · 12.02.2026 г., 15:01

News: #TPLF says it ‘will not stay idle’ if #Pretoria deal is breached, urges AU, US, EU to move beyond concern statements The chairman of the Tigray People’s Liberation Front (TPLF), Debretsion Gebremichael (PhD), has warned that the party “will not stay idle” if the Pretoria Cessation of Hostilities Agreement (#CoHA) is breached and the group comes under attack, while dismissing claims that it has been “weakened and dispersed.” He also urged international actors including the African Union (#AU), the #United_States, and the European Union (#EU) to move beyond expressions of concern and take concrete action to safeguard the fragile peace process. Speaking at a press briefing today, Debretsion rejected assertions that the TPLF has lost cohesion. “They say we are weakened and dispersed. But our answer is: we are not dispersed when it comes to our survival and security,” he said. Debretsion also said he has been in frequent contact with representatives.... Read more: https://addisstandard.com/?p=55172

Addis Standard

@addisstandardeng · Post #21252 · 30.01.2026 г., 12:56

News: #Tigray opposition parties urge international mediators to intervene as tensions raise fears of renewed war Several Tigray-based opposition political parties have issued separate open letters warning of an imminent risk of renewed conflict in the region and calling on international mediators and guarantors of the Cessation of Hostilities Agreement (#CoHA) to take urgent preventive action. Salsay Weyane Tigray (#SaWeT) and the Tigray Independence Party (#TIP), in letters addressed to the #United_Nations, the African Union (#AU), the #United_States, the #European_Union, and other guarantors and facilitators of the Pretoria peace agreement, expressed deep concern over what they described as escalating political and military tensions that could unravel the fragile peace in Tigray. In its open letter, SaWeT warned that the region is “on the brink of an absolutely preventable disaster,” saying that a growing military confrontation threatens the collapse of ….. Read more: https://addisstandard.com/?p=54847