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

Пребарај: #eubeachcleanupcampaign

当前筛选 #eubeachcleanupcampaign清除筛选
EU in Kazakhstan 🇪🇺🇰🇿

@euinkazakhstan · Post #958 · 21.09.2024 г., 13:23

21 September2024 ASTANA – As part of World Cleanup Day and the #EUBeachCleanup environmental campaign, the Delegation of the European Union to Kazakhstan, in collaboration with the Estonian Embassy in Kazakhstan and with the support of the Akimat of Astana and the environmental movement “We are for a clean country” organized a cleanup event along the banks of the Karasu River in Astana on September 21, 2024. In her address to participants, the Head of the EU Delegation to Kazakhstan, Ms. Aleska Simkic, remarked: “Today's #EUBeachCleanup campaign is more than just picking up litter. It is about taking responsibility for our planet. Each and everyone of us can contribute, by decreasing his/her carbon footprint – at least not litter, by making those close to him/her aware of the importance of individual action and by influencing the politicians of our countries to enforce policies for cleaner environment. Together, we can tackle waste pollution and inspire lasting change. When communities unite, we can build a cleaner, greener future for Kazakhstan and the world.” Ambassador of Estonia to Kazakhstan, Mr. Jaap Ora, extended his gratitude to the Akimat of the City of Astana, local environmental activists, the EU Delegation to Kazakhstan, and all participants of the World Cleanup Day in Kazakhstan. “This shows our joint commitment to preserving the environment. This year is particularly significant, as World Cleanup Day, which originated in Estonia, has been officially added to the UN Calendar of International Days starting from 2024. This recognition will undoubtedly enhance its visibility and impact.” The event brought together around 300 participants, including diplomats and staff from embassies representing countries of Europe, America, Asia, and Africa, as well as representatives from international organizations and the Youth Public Association of the Earth Foundation, local residents and visitors to the Capital alsojoined in, cleaning the banks of the Karasu River of litter and waste. World Cleanup Day and the #EUBeachCleanup campaign were also supported by all regions and cities of Kazakhstan, making it part of the large-scale environmental campaign “Taza Qazaqstan”. This made the campaign part of a nationwide effort to raise awareness about cleanliness and promote the development of ecological culture. On this day, winners of the Instagram Reels contest – which encouraged participants to showcase their eco-friendly habits – were awarded with special prizes. In addition, thanks to the efforts of the participants, a large number of plastic bottles were collected and sent for recycling. To conclude the event, participants took part in a flash mob, forming a large heart to symbolize their love for Planet Earth. As part of this significant environmental initiative, a teleconference was organized between the UN Office in New York and Astana. During a live broadcast, Ms. Heidi Solba, President and Head of the global network Let’s Do It World and World Cleanup Day, discussed the importance of this action and highlighted Kazakhstan’s role in the global environmental movement. The European Union Delegation and the Estonian Embassy in Kazakhstan extend their deepest gratitude to all partners and participants of World Cleanup Day and the #EUBeachCleanupcampaign! Background information: World Cleanup Day is one of the largest global movements that unites millions of volunteers, governments and organisations. With 19,068,786 participants from a new high of 198 countries and territories – which includes a new high of 90% of UN member states – WCD marked a return to pre-Covid engagement levels, with the movement’s second-highest annual turnout. From 2024, World Cleanup Day is declared an official UN Day, on 20 September annually, and has now been added to their Calendar of International Days and Weeks. This world-changing idea began in Estonia, in 2008. #EUBeachCleanup is a more focussed global campaign organised by the EU and the UN to raise awareness about plastic pollution all over the world.