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

Пребарај: #uluwatu

当前筛选 #uluwatu清除筛选
Bali News

@balinews · Post #457 · 08.07.2025 г., 09:55

🏚Demolition of illegal buildings has begun in Bingin 📰 Protests have been unsuccessful. Mass demolition of illegal buildings has begun on Bingin Beach: more than forty warungs, boutique hotels, and surf schools are to be dismantled. 📍 The authorities call it the restoration of state land, while local entrepreneurs fear losing their only source of income. Among the establishments that are to disappear from the coastal map are the varungs Didi's, Kelly's, and Ombak. #beaches#Uluwatu#realestate@BaliNews

Bali News

@balinews · Post #132 · 02.08.2024 г., 10:01

🏄‍♀️Rip Curl Cup kicked off in Uluwatu 📍 One of the most prestigious competitions in world surfing has started at the Balinese spot Padang Padang. 🌊 On which of the days in August the awards will be drawn, no one knows. Organizers, judges and athletes will be waiting for the best waves, the so-called "pipes", to show all that they know how to do for a month. 🏆 This year the format of the Rip Curl Cup has been updated. The organizers decided to follow the ideas of gender equality and agreed to hold separate competitions for women at the same time with men. The last time this happened in Bali was 21 years ago. President of Rip Curl Indonesia James Hendy explained that the decision to create a women's division this year was made after the success of Canadian surfer Erin Brooks, who competed with men at the last Rip Curl Cup last year and reached the final, in which at first even led. 🖥 You can watch the broadcast of the championship itself, as well as find out the date of the championship at the link. 🎉 The main party of Rip Curl Cup-2024 will start at 17:00 on August 30 and will continue until midnight. @BaliNews #events#beaches#beaches#sports#Uluwatu

Bali News

@balinews · Post #120 · 19.07.2024 г., 11:02

🛣Details about the construction of a district road in Bukit District authorities are set to solve the road issue in Uluwatu by laying a new district road. Construction of the first section from Siligita village to Sawangan in Nusa Dua district has already started. The original idea was to extend the toll road, which now runs from the airport to Nusa Dua, all the way to Uluwatu. Right now, traffic on the main road jl. Uluwatu is difficult because it is both a hub of commerce and the main thoroughfare of the area, used by everyone from locals to construction vehicles and tour buses. The land acquisition budget for 2024 will be $16 million, with the next one already promised to increase to $19 million. According to an insider in Bali's land office, all consideration of new housing development in the green zone on Bukit is now halted just in time for the land acquisition for the new roads. @BaliNews #roads#roads#authorities#Bukit#Uluwatu#NusaDua