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

Резултати

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

Пребарај: #aden

当前筛选 #aden清除筛选
Reuters: World

@reutersworldchannel · Post #149187 · 10.10.2021 г., 17:23

WARNING: GRAPHIC CONTENT: Car bomb in Yemen's Aden leaves fatalities A car bomb targeting the governor's convoy shook Yemen's southern port city of Aden, killing several people #News#Reuters#Yemen#CarBomb#Aden Subscribe: http://smarturl.it/reuterssubscribe Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled. Get the latest news on: http://reuters.com/ Follow Reuters on Facebook: https://www.facebook.com/Reuters Follow Reuters on Twitter: https://twitter.com/Reuters Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en ➖@reutersworldchannel➖

Addis Standard

@addisstandardeng · Post #21285 · 03.02.2026 г., 06:35

#Yemen Agriculture ministry condemns #Eritrean & #Somali attacks on Yemeni Fishermen The Agriculture, Fisheries and Water Resources Ministry strongly condemned the criminal attacks and repeated violations targeting Yemeni fishermen in the #Red_Sea and the Gulf of #Aden by the Eritrean authorities and the authorities of the Somali region, describing them as a blatant violation of international, humanitarian, and maritime laws, norms, and conventions. In a statement received by the Yemeni News Agency (Saba), the Ministry explained that Eritrean forces carried out a direct armed attack using live ammunition against civilian Yemeni fishermen within the territorial waters of the Republic of Yemen in the Red Sea, resulting in deaths and injuries, as well as the detention of a number of fishermen who were forcibly taken away. The Ministry considered these actions a dangerous escalation that threatens the safety, security of fishermen, targets their livelihoods and ..... https://saba.ye/en/news3639829.htm

Addis Standard

@addisstandardeng · Post #21699 · 13.03.2026 г., 06:55

#Somalia warns against any #Israeli base plans on #Somaliland Somalia has warned that its territory cannot be used as a launching pad for military operations, after two media reports that said Israel is planning to establish a military base in the breakaway region of Somaliland, directly across the Gulf of #Aden from #Yemen. “Somalia does not want to see its territory pulled into external confrontations or used in ways that could further destabilise an already sensitive region,” Ali Omar, Somalia’s state minister for foreign affairs, told Al Jazeera on Thursday. The warning from #Mogadishu comes after #US outlet Bloomberg and Sweden’s public radio Ekot reported this week about Israeli plans for a military installation near the strategic port city of #Berbera on the Gulf of Aden. The reports come as the US Israeli war on Iran edges towards its second week, with the Strait of Hormuz effectively closed...... https://www.aljazeera.com/news/2026/3/12/somalia-warns-against-any-israeli-base-plans-on-somaliland