Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
On May 27, 2025, an official meeting was held at the Somon Air office between the airline's management and representatives of Xinjiang Airport Group Co., Ltd.
During the meeting, the parties discussed the current state of the international aviation services market, including between Xinjiang and the Central Asian countries. The purpose of the Chinese delegation’s visit was to explore prospects for mutually beneficial cooperation and to engage in in-depth dialogue on the development of air communication and the expansion of the route network between cities in the Republic of Tajikistan and cities in the Xinjiang Uyghur Autonomous Region of the People’s Republic of China.
Xinjiang Airport Group Co., Ltd was represented at the meeting by General Manager of Xinjiang Airport Group Lu Huibin and Director of Marketing Committee Zhang Jun.
#somonair#xinjiang#aviation
👏Такла-Макан: от «Моря Смерти» к зеленому оазису
🔹Пустыня Такла-Макан, когда-то известная как грозное «Море Смерти», веками отпугивала путешественников. Но всего за последний год в уезде Юйтянь (Синьцзян-Уйгурский автономный район, Китай) были преобразованы огромные участки бесплодных земель на окраинах этой пустыни.
🌳 Хотите увидеть, как пески медленно, но верно превращаются в процветающий зеленый оазис? Тогда смотрите видео! 🤩
#explorexinjiang#Синьцзян#Xinjiang#TaklimakanDesert
China uses one official time zone: China Standard Time (CST), 8 hours ahead of UTC, called Beijing Time. In Xinjiang, many Uyghurs use Xinjiang Time, 2 hours behind CST. China does not change clocks for Daylight Saving Time.
To see the current time check [here]
@googlefactss⏰🇨🇳
#China#TimeZone#CST#Xinjiang#BeijingTime#funfact
As Europe deepens its economic ties with China, its willingness to confront Beijing over human rights abuses appears to be waning. A recent article highlights how European nations are prioritizing trade and diplomacy, even as concerns about rights violations in Xinjiang and Tibet persist. Critics warn that this compromises Europe's commitment to human rights and raises questions about its moral leadership on the global stage.
#EuropeChinaRelations#HumanRights#Xinjiang#Tibet#GlobalDiplomacy#TheEconomist
隨著歐洲加強與中國的經濟聯繫,對北京人權問題的關注似乎日漸減弱。一篇最新文章指出,儘管新疆和西藏的權益問題仍存,歐洲各國卻更注重貿易和外交關係。有批評者警告,這將削弱歐洲對人權的承諾,並對其全球道德領導力提出質疑。
#歐中關係#人權問題#新疆#西藏#全球外交#經濟學人
https://www.economist.com/international/2025/03/25/europe-will-have-to-zip-its-lip-over-chinas-abuses
#Beijing_Review🇨🇳📕[PDF]⬇️
2 #October2025
#Weekly_Magazines
For learning, for free(dom).
@backupofmagazines
In this issue , the spotlight shines on #Xinjiang 70, celebrating seven decades of transformation in the autonomous region—from economic health to cultural heritage. Global topics include #PalestineRecognition, evolving #ChinaUS relations, and the healing potential of dialogue via the #XiangshanForum. Special features explore #RuralRevitalization and tech-driven change in Qingdao and Fujian, as #ScienceInnovation takes center stage. From the vibrant Grand Bazaar to a Somali expat’s vision, this issue captures both regional pride and global dialogue. #BeijingReview#CulturalDiversity#BeltAndRoad#EducationMatters#ChinaPerspective