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 слични објави

Пребарај: #noninterference

当前筛选 #noninterference清除筛选

@RusEmbMalta Press Release: 🇷🇺 Russia Stands for Peace, Dialogue and Sovereignty in the Balkans The Embassy of the Russian Federation in Malta draws attention to the situation in Bosnia and Herzegovina, which continues to raise serious concern. 🇷🇺Russia firmly opposes the ongoing attempts by Western members of the Peace Implementation Council to distort the Dayton Peace Agreement (1995) and to impose a centralized political model on Bosnia and Herzegovina under external control. Such actions undermine the very foundation of the Dayton framework endorsed by UN Security Council Resolution 1031 (1995), threaten the coexistence of the three constituent peoples – Bosniaks, Serbs and Croats – and erode the autonomy of the Republika Srpska and the Federation of Bosnia and Herzegovina. 🕊️ Moscow’s position is clear: the future of Bosnia and Herzegovina must be determined by its peoples through equal dialogue and consensus, not through diktat from abroad. The activities of the so-called “High Representative” Christian Schmidt – who was never approved by the UN Security Council – have no legitimacy and represent direct interference in the internal affairs of a sovereign state. 🇷🇸 Russia also consistently defends the sovereignty and territorial integrity of the Republic of Serbia, as reaffirmed in UN Security Council Resolution 1244 (1999). Attempts by Western countries to legitimise Pristina’s unilateral declarations and to pressure Belgrade into recognition of Kosovo are unlawful and destabilising. The imposition of such neo-colonial schemes in the Balkans only deepens divisions and fuels tension across the region. 🌐 Russia calls on all responsible members of the international community to defend the principles of the Dayton and UN frameworks, to respect the sovereignty of Balkan states, and to prevent the erosion of peace and stability in South-Eastern Europe. #Russia#BosniaAndHerzegovina#RepublikaSrpska#Serbia#Kosovo#DaytonAgreement#Sovereignty#NonInterference🇷🇺🤝🇧🇦🇷🇸