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

Резултати

Пронајдени 50 слични објави

Пребарај: #raspberry

当前筛选 #raspberry清除筛选
Linuxgram 🐧

@linuxgram · Post #18754 · 12.05.2026 г., 08:32

📰 My Raspberry Pi 4 still has a job in my homelab, and it isn't Home Assistant I ran Home Assistant on a Raspberry Pi 4 for over a year. Though the Pi booted from an NVMe SSD, the Pi's 4GB memory limit became difficult to ignore as I built ESPHome devices. Recently, I moved Home Assistant to a mini PC and almost shelved the Pi, since it was just sitting in the corner doing nothing. 🔗 Source: https://www.xda-developers.com/raspberry-pi-4-homelab-without-home-assistant/ #raspberry

Hashtags

Linuxgram 🐧

@linuxgram · Post #18710 · 08.05.2026 г., 10:51

📰 Your smart home needs both an ESP32 and Raspberry Pi 5, not one or the other For the past few months, I’ve been making the case for the ESP32. I'd argue that the $5 ESP32 microcontroller can easily replace the Raspberry Pi 5. That helps to save on cost and reduce the bulk. I still believe that. 🔗 Source: https://www.xda-developers.com/your-smart-home-needs-an-esp32-and-raspberry-pi/ #raspberry

Hashtags

Linuxgram 🐧

@linuxgram · Post #18681 · 05.05.2026 г., 20:42

📰 Raspberry Pi Imager Now Supports Raspberry Pi Connect for Organizations Raspberry Pi Imager 2.0.9 flashing tool for Raspberry Pi devices is now available for download with support for Raspberry Pi Connect for Organizations and many other changes. 🔗 Source: https://9to5linux.com/raspberry-pi-imager-now-supports-raspberry-pi-connect-for-organizations #raspberry

Hashtags

Linuxgram 🐧

@linuxgram · Post #18668 · 04.05.2026 г., 12:24

📰 Raspberry Pi 5's price hike pushed me toward mini PCs, and now I can't justify going back When Raspberry Pi 5 got a price hike, my first reaction was to pause and re-evaluate my plans. I’ve been running a Pi 4 as my home lab for years, and I've always wanted to upgrade to the Pi 5. After waiting for stock availability, I decided to take my requirements more seriously. 🔗 Source: https://www.xda-developers.com/raspberry-pi-5-price-hike-pushed-me-to-mini-pcs/ #raspberry

Hashtags

Linuxgram 🐧

@linuxgram · Post #18660 · 03.05.2026 г., 07:31

📰 I replaced my Raspberry Pis with $5 ESP32s for smart home projects, and they do everything I need My smart home doesn't need a Raspberry Pi anymore, and the ESP32 just proved it. 🔗 Source: https://www.xda-developers.com/i-replaced-raspberry-pis-with-5-esp32s-for-home-assistant/ #raspberry

Hashtags

Linuxgram 🐧

@linuxgram · Post #18639 · 01.05.2026 г., 07:59

📰 Running local AI on the Raspberry Pi 5 taught me why cloud models are still winning Except for Google's AI responses to searches, I've never used AI before, not once. Most people I know, when they hear this, say, "You haven't used AI? But it's so useful!" I disagreed; I'd seen the results Google's AI gave, and it honestly seemed overhyped. Then I thought about it and realized I couldn't really judge it without testing it. However, being into tech, I didn't want to risk my privacy, knowing the impact that can have, so I wanted... 🔗 Source: https://www.xda-developers.com/local-ai-raspberry-pi-5-positive-negative/ #raspberry

Hashtags

Linuxgram 🐧

@linuxgram · Post #18570 · 25.04.2026 г., 20:47

📰 I turned a Raspberry Pi and mini PC into a portable homelab that fits in my backpack I love my homelab — but accessing it remotely from a hotel or café only gets me so far. That remote connection works fine for simpler tasks like checking dashboards, running scripts, waking up, or shutting down machines. But anything heavier — large file transfers, streaming, or running intensive workloads — quickly reveals public Wi-Fi’s limitations. 🔗 Source: https://www.xda-developers.com/turned-raspberry-pi-mini-pc-into-portable-homelab-that-fits-backpack/ #raspberry

Hashtags

Linuxgram 🐧

@linuxgram · Post #18522 · 22.04.2026 г., 05:14

📰 Someone turned an ESP32 T-LoRa Pager into a portable music machine, and you can too While Raspberry Pis and ESP32s are great for hobbyists, they also regularly find themselves in products. They're very useful, after all, so it's only natural that companies will use them as their hardware of choice when making something small that doesn't need to be an absolute powerhouse. 🔗 Source: https://www.xda-developers.com/someone-turned-an-esp32-t-lora-pager-into-a-portable-music-machine-and-you-can-too/ #raspberry

Hashtags

Linuxgram 🐧

@linuxgram · Post #18501 · 20.04.2026 г., 21:06

📰 I stopped trusting my router's diagnostics after my Raspberry Pi found what it missed Lately, I’ve been working on a lot of ESP32 projects, so I keep checking my router for connectivity. But those devices kept showing as connected even when powered off. That made me question whether my router was giving me the full picture. 🔗 Source: https://www.xda-developers.com/stopped-trusting-routers-diagnostics-after-raspberry-pi-found-what-missed/ #raspberry

Hashtags

Linuxgram 🐧

@linuxgram · Post #18476 · 18.04.2026 г., 05:46

📰 My Raspberry Pi NAS taught me that cheap storage isn't worth the compromise A NAS without dependable storage is just a very patient disappointment. 🔗 Source: https://www.xda-developers.com/raspberry-pi-nas-taught-cheap-storage-isnt-worth-compromise/ #raspberry

Hashtags

Linuxgram 🐧

@linuxgram · Post #18455 · 16.04.2026 г., 07:46

📰 Travel computing doesn't need a laptop — the Raspberry Pi 5 proved that to me For the right traveler, the Raspberry Pi 5 is more than just adequate on the road. 🔗 Source: https://www.xda-developers.com/travel-computing-doesnt-need-laptop-raspberry-pi-5-proved/ #raspberry

Hashtags

Linuxgram 🐧

@linuxgram · Post #18445 · 15.04.2026 г., 12:18

📰Raspberry Pi OS ends open-door policy for sudo Command prefix will require password by default The latest version of Raspberry Pi OS now requires a password for sudo by default.… 🔗 Source: https://go.theregister.com/feed/www.theregister.com/2026/04/15/raspberry_pi_os_sudo/ #raspberry

Hashtags

ПретходнаСтраница 1 од 5Следна