Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
STON.fi Celebrates Successful Event in Tbilisi
#TON#Tbilisi#TONCommunity
At the recent meet-up in Tbilisi, STON.fi brought together the TON community with passionate discussions and showcases of innovative projects. The event, co-hosted by TON Georgia, highlighted the diversity of voices contributing to the growth of the TON ecosystem.
Source: link
@tonlines
🎧⤴
💎 Telegram’s Crypto Bot Launches Fee-Free Coin Swaps – Best Rates on TON and Beyond!
Telegram’s popular Crypto Bot introduced a groundbreaking Swap feature, enabling seamless exchanges of cryptocurrencies, including TON, at optimal market prices with 0% commission. This new feature empowers users to swap tokens effortlessly, catering to the needs of both seasoned traders and beginners. As Telegram strengthens its ties with The Open Network (TON), this development marks a significant step towards making zero-fee crypto trading more accessible and user-friendly. TON, Telegram, and crypto swaps headline this exciting update.
Chorus:
Swap it, drop it, no fees, we poppin’,
Crypto bot’s live, TON fam’s watchin’.
Best market rates, yeah, that’s the notion,
Zero percent, ridin’ this motion.
Verse 1:
Telegram’s bot, now it’s all in play,
Swappin’ TON coins without delay.
Zero fees stack, in a major way,
Crypto’s here to stay, what more to say?
Swipe right, the trades ignite,
Swappin' at the best rates, day or night.
TON on deck, the moves in sight,
Crypto bot’s game changin’, feelin’ right.
Chorus:
Swap it, drop it, no fees, we poppin’,
Crypto bot’s live, TON fam’s watchin’.
Best market rates, yeah, that’s the notion,
Zero percent, ridin’ this motion.
Verse 2:
From TON to ETH or BTC, quick like a flash,
One tap on Telegram, and the coins clash.
Zero fees givin' more green in the stash,
Crypto bot’s hustle, bringin’ in cash.
Telegram links up with TON,
Best swaps, no cap, just get it done.
In the market, bots always on the run,
Swappin’ coins, and we're havin' fun.
Chorus:
Swap it, drop it, no fees, we poppin’,
Crypto bot’s live, TON fam’s watchin’.
Best market rates, yeah, that’s the notion,
Zero percent, ridin’ this motion.
Verse 3:
Telegram and TON, now we’re connectin’,
Coins on the move, the fam’s respectin’.
Best rates, zero fees, no second-guessin’,
Crypto's risin', it's impressin'.
Swap so quick, it’s like a race,
Crypto bot's here, savin' time and space.
TON's in the mix, the market’s embrace,
With zero fees, everyone finds their place.
Chorus:
Swap it, drop it, no fees, we poppin’,
Crypto bot’s live, TON fam’s watchin’.
Best market rates, yeah, that’s the notion,
Zero percent, ridin’ this motion.
Bridge:
TON in the mix, we set the tone,
Zero fees, we break the stone.
Crypto bot's king on this throne,
This is the future, watch it be known.
#TONCommunity#CryptoSwap#TON
#TONCryptoNewsRapStyle
🎧@toncoin_rap
🙏SBT ONTON in real time!
🔍 Our chat has a bot that monitors the emergence of new SBTs in real time — they appear instantly along with passwords!
❤️ No need to search for them in different chats anymore - just join our community and get valuable Soul Bound Tokens to your wallet, so that you can get a drop for them later!
🟣Claim your SBT ONTON now!
#TON#ONTON#SBT#Airdrop#Web3#TONCommunity