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

Резултати

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

Пребарај: #may

当前筛选 #may清除筛选
TN MiniCrypto Official

@swift_airdrops · Post #5188 · 11.05.2024 г., 18:50

🔥 OGCommunity App for daily activity and grabbing OGC tokens for free and many more. 👉 Join Bot for Airdrop :- https://t.me/OGCommunityBot?start=i09w6Cfm9nz7V5wMcLjJVJpz ➖ Click on bot link ➖ Click on open app ➖ Complete tasks to get instant OGC tokens ➖ Mine every day & Done #Note :- Join fast before #May 31st 🔥

Hashtags

悦读「优质少量RSS聚合」

@Dailyrss · Post #13350 · 16.05.2026 г., 00:45

Wikipedia每日一图(#May 16, 2026)https://ift.tt/ixodInV Partially frozen Gurudongmar Lake, a glacial lake located to the north of the Himalayas in the northeast Indian state of Sikkim at an altitude of over 5,150 metres (16,900 ft). The lake is fed by glaciers of the Khangchengyao massif, forms the headwaters of the Teesta river and is considered sacred by Buddhists and Sikhs. Today is Sikkim Day, which commemorates the formation of Sikkim as a state of India in 1975, following a popular referendum and full merger after decades of being a protectorate since 1947.. 了解更多 . #Wikipedia每日一图

悦读「优质少量RSS聚合」

@Dailyrss · Post #13347 · 13.05.2026 г., 00:45

Wikipedia每日一图(#May 13, 2026)https://ift.tt/UjxK9Pg This azulejo from the Igreja de São Bento (Ribeira Brava, Madeira, Portugal) depicts Our Lady of Fátima. Today is the feast of Our Lady of Fátima in the Catholic Church and the 110th anniversary of her first apparition to three shepherd children.. 了解更多 . #Wikipedia每日一图

悦读「优质少量RSS聚合」

@Dailyrss · Post #13346 · 12.05.2026 г., 00:45

Wikipedia每日一图(#May 12, 2026)https://ift.tt/EpzY47y Aerial view of the ruins of Takht-i-Bahi, a 1st-century CE Buddhist monastery complex located in what was once the ancient Indian region of Gandhara, in the present-day northern Pakistani province of Khyber Pakhtunkhwa. It is representative of Buddhist monastic architecture from its era and the ruins were listed as a World Heritage Site in 1980, with UNESCO describing it as having been "exceptionally well-preserved".. 了解更多 . #Wikipedia每日一图

123•••56
ПретходнаСтраница 1 од 6Следна