Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
🟩Let's Share $150,000 in ZETA! zetablockchain
🎯Ready for an immersive experience with #ZetaChain Testnet before the mainnet launch and a chance for potential airdrops?
JOIN NOW 👉https://tp-lab.tptool.pro/tokenpocket-christmas/?locale=en#/ Galxe 👉https://galxe.com/TokenPocket/campaign/GCc28ttYTk
With such incredible projects, the anticipation for the #ZetaChain mainnet is booming! zetaswapdex LENX_Finance zkme_ UltiverseDAO SushiSwap ChatGM_Official CharacterXAI sugar_datingfi eddy_protocol TokenPocket_TP
【Details】https://twitter.com/TokenPocket_TP/status/1746790100393206137
【Powered By】Crypto Box
🆕 ZetaChain Testnet is Now Live on TokenPocket! zetablockchain
▶️Supported by TokenPocket Mobile Wallet and Chrome Extension Wallet!
TokenPocket now supports users to
✅ Custom add #ZetaChain Testnet to TokenPocket.
✅ Create & Import #ZetaChain wallets.
✅ Interact with #ZetaChain Testnet-based DApps.
🚀 Create your first #ZetaChain wallet on TokenPocket_TP!
Use Guide👉https://help.tokenpocket.pro/en/wallet-operation/how-to-create-a-wallet/zetachain-testnet
👉https://www.tokenpocket.pro/
👉https://extension.tokenpocket.pro/#/
【Details】https://twitter.com/TokenPocket_TP/status/1704418412582338967
【Powered By】Crypto Box
🆕#ZetaChain is now live on TokenPocket_TP. zetablockchain
💚ZetaChain is a simple, fast, and secure Omnichain Blockchain.
🚀How to create/import a #ZetaChain wallet on #TokenPocket Mobile Wallet and Chrome Extension Wallet?
Guide👉https://help.tokenpocket.pro/en/wallet-operation/how-to-create-a-wallet/zetachain
Download #TokenPocket
👉https://www.tokenpocket.pro/
👉https://extension.tokenpocket.pro/
#ZetaChain#TokenPocket $ZETA
【Details】https://twitter.com/TokenPocket_TP/status/1752905240133996845
【Powered By】Crypto Box
💥@zetablockchain Ecosystem is booming!!
💚You won't want to miss a chance to share 1,000 #ZETA, right? Dive into👇
https://galxe.com/TokenPocket/campaign/GCEZRtwWpG
🎯How to create & import a #ZetaChain wallet on TokenPocket_TP?
Full guide👇
(For mobile and Chrome extension users.)
【Details】https://twitter.com/TokenPocket_TP/status/1753242729960628260
【Powered By】Crypto Box
💥We’re excited to announce that #TokenPocketChristmas winners can claim rewards at
@ZetaBlockchain
mainnet launch! #ZetaChain
Check if you are on the first-round winner list
👉https://docs.google.com/spreadsheets/d/1zqZx0BHE0gVBn8doFhRAdFBaQrwoxzPbwu2CYCOkvhs/edit#gid=0
How to claim your #ZETA?
1️⃣Download TokenPocket Wallet
👉https://tokenpocket.pro
👉https://extension.tokenpocket.pro
2️⃣Create/import/sync your #ZetaChain wallet on TokenPocket after mainnet launch!
3️⃣Share the news with your friends if you are on the winner list! (RT, Like, Comment) 👉https://twitter.com/TokenPocket_TP/status/1752147092942749951
When to get your ZETA?
⏰The rewards will be distributed at the same time of #ZetaChain airdrop claim opens this week.
All participating user data from #TokenPocket are also whitelisted to get a boost in the first XP campaign on ZetaHub. Learn more about the 10% of the total ZETA token supply for community rewards: https://twitter.com/zetablockchain/status/1750758520637804707
AI Agent Launchpad Goes Live
Zearn launches the world’s first Universal AI Agent launchpad using autonomous AI on ZetaChain’s infrastructure. Users can create meme narratives and deploy AI agents in just three clicks, leveraging real-time social sentiment for refinement. Read more here.
Additionally, Utah's Bitcoin reserve bill has passed the Senate Revenue and Taxation Committee, marking a significant step for cryptocurrency regulation in the state.
#AI#Crypto#Zearn#ZetaChain#Bitcoin#Blockchain#Utah#Innovation
Quoted TokenPocket_TP : 💥All the #TokenPocketChristmas rewards have been distributed to winners' TokenPocket #ZetaChain Wallet!! #HODL
To celebrate the #ZetaChain Mainnet launched, TokenPocket provides 1,000 #ZETA to #TokenPocket users!
Dive into👇
https://galxe.com/TokenPocket/campaign/GCEZRtwWpG#ZetaChain
😁Eligible for TokenPocket users, please create/import a #ZetaChain wallet on #TokenPocket Mobile Wallet and Chrome Extension Wallet?
Guide👉https://help.tokenpocket.pro/en/wallet-operation/how-to-create-a-wallet/zetachain
【Details】https://twitter.com/TokenPocket_TP/status/1752914758746210773
【Powered By】Crypto Box