TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #60 · 31 мар.

Вторая по частоте future-функция, которую я использовал, это абсолютный импорт from __future__ import absolute_import Что она делает? Изменения, которые вносит эта инъекция описаны в PEP328 Покажу простой пример. Допустим, есть такой пакет: /my_package /__init__.py /main.py /string.py Смотрим код в my_package/main.py # main.py import string Простой пример готов) Вопрос в том, какой модуль импортируется в данном случае? Есть два варианта: 1. модуль в моём пакете my_package.string 2. стандартный модуль string И вот тут вступает в дело приоритет импортов. В Python2 порядок следующий: помимо иных источников, раньше ищется модуль внутри текущего пакета, а потом в стандартных библиотеках. Таким образом мы импортнём my_package.string. Но в Python3 это поведение изменилось. Если мы указываем просто имя пакета, то ищется именно такой модуль, игнорируя имена в текущем пакете. Если мы хотим импортнуть именно подмодуль из нашего пакета то, мы должны теперь явно это указывать. from my_package import string или относительный импорт, но с указанием пути относительно текущего модуля main from . import string Еще одной неоднозначностью меньше 😎 Подробней про импорты здесь: https://docs.python.org/3/tutorial/modules.html #2to3#pep#basic

Резултати

Пронајдени 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Следна