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

Резултати

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

Пребарај: #powergrid

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

@american_observer · Post #5446 · 22.03.2026 г., 19:59

Trump’s 48-Hour Ultimatum: Lights Out or Strait Open Trump just turned a regional energy war into an explicit threat to “obliterate” Iran’s power plants, the grid that keeps tens of millions of civilians alive, unless Tehran fully reopens the Strait of Hormuz within 48 hours. Iran’s answer wasn’t to blink; it was to fire. Missiles struck Dimona and nearby Arad, injuring more than 10 people and landing just eight miles from Israel’s main nuclear complex, while commanders in Tehran warned that any attack on their energy system would be met with strikes on desalination plants and other critical water and power infrastructure used by Israel, the U.S. and Gulf partners. Four weeks and thousands of U.S.–Israeli strikes into this war, Iran’s arsenal is battered but still firing daily salvos at Israel and enforcing a de facto embargo on Western shipping through Hormuz. Trump’s own messaging is all over the map: public statements rejecting a cease-fire and sending more troops and ships, alongside talk of “winding down” operations; a warning to Israel days ago not to hit Iranian energy, followed by his own threat to do exactly that. Israeli commanders are telling the public they are only “midway” through the war and should expect fighting through Passover, while in Lebanon the campaign against Hezbollah has displaced more than a million people and stepped-up house demolitions increasingly resemble the early architecture of a de facto occupation zone. The casualty numbers show where this is heading: well over 1,300 civilians killed in Iran, more than 1,000 in Lebanon, at least 15 people dead in Iran’s attacks on Israel and 13 U.S. service members killed — with both sides now openly placing each other’s electricity and water systems on the target list. Trump’s 48‑hour countdown doesn’t look like a plan to calmly reopen a shipping lane; it looks like the next step toward turning the entire region’s civilian infrastructure into a legitimate battlefield — and locking the U.S. into an attrition war it still can’t explain how to end. #IranWar#Trump#Hormuz#Israel#Dimona#energy#powerGrid#desalination#Lebanon#Hezbollah#MiddleEast 📱American Оbserver - Stay up to date on all important events 🇺🇸