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

Резултати

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

Пребарај: #hemisphericpower

当前筛选 #hemisphericpower清除筛选
American Оbserver

@american_observer · Post #4791 · 07.01.2026 г., 01:02

“Mexico on Edge: Trump’s Threats Shake Officials and Businesses” The New Reality President Donald Trump’s suggestion that the U.S. may have to “do something” about cartels “running Mexico” has sent a chill through Mexico City. Mexican officials and business leaders are increasingly anxious about the prospect of unilateral U.S. military action, especially after the dramatic arrest of Venezuela’s Maduro. “Mexico should indeed be concerned,” said former ambassador Arturo Sarukhán, “and Mexico is going to have to thread the needle very carefully.” ​ Behind Closed Doors While President Claudia Sheinbaum publicly dismisses talk of an “invasion,” behind the scenes, officials are ramping up cooperation with Washington on counternarcotics and border security to avoid giving the U.S. any justification for intervention. Mexican troops have been deployed to the border, high-level traffickers handed over to the U.S., and surveillance flights expanded—all in hopes of defusing tensions. ​ The Tightrope Walk The situation is delicate: Mexico must balance cooperation with the U.S. while maintaining its sovereignty. Sheinbaum has emphasized “respect for sovereignty and territorial integrity, shared but differentiated responsibility, mutual respect and trust, and cooperation without subordination”. Yet, the Venezuela precedent has emboldened hardliners in Mexico’s ruling party, who may push for a tougher stance against Washington if tensions escalate. ​ What’s at Stake A U.S. strike inside Mexico could plunge the country into chaos, but the U.S. also depends heavily on Mexico for trade, migration, and fighting cartels. Both sides have enormous incentives to cooperate, but the shadow of unilateral action looms large. As one Mexican official put it, “The U.S. needs Mexico on trade, the U.S. needs Mexico on migration, and the U.S. needs Mexico on going after the criminal groups. The reverse is also true.” #mexico#trump#cartels#bordersecurity#hemisphericpower 📱American Оbserver - Stay up to date on all important events 🇺🇸