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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #197 · 4 јан.

Подразумеваемые неймспейсы или неявные пакеты. Этот функционал добавлен в Python 3.3 Что он означает? Ранее, до 3.3 пакетами считались лишь директории, в которых есть файл __init__.py. Этот файл одновременно являлся свидетельством того, что директория это Python-пакет, и служил "телом" этого пакета. То есть местом, где можно написать код, как это делается внутри модуля. Этот код исполняется в момент импорта пакета, так что его принято называть "код инициализации пакета". Начиная с версии 3.3 Любая директория считается пакетом и Python будет пытаться использовать любую директорию для импорта. Конечно, не любую в файловой системе, а только те что находятся в sys.path. Это значит, что теперь __init__.py нужно делать только если: 🔸 вам требуется создать код инициализации пакета 🔸 нужна совместимость со старыми версиями Python На мой взгляд это немного упрощает разработку, делает её чище, но с другой стороны убивает некоторую однозначность происходящего. Например, я создал репозиторий со своей библиотекой и рядом положил код примеров или тестов. repo_name/ my_library/ __init__.py main.py examples/ exam1.py exam2.py В этом репозитории пакетом является только my_library, остальные директории это не пакеты, это просто дополнительный код в файлах. Директория examples не добавлена в sys.path, в ней нет рабочих модулей. Но если она лежит рядом с my_library, то Python вполне сможет импортнуть из неё модули, так как посчитает что examples это валидный пакет. Конечно, пример несколько надуманный. Никто не будет добавлять корень репозитория в sys.path. Но, я думаю, суть ясна. Иногда директория это просто директория а не пакет! #basic#pep

Hashtags

Резултати

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

Пребарај: #opensource

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

@linuxgram · Post #18798 · 14.05.2026 г., 22:05

📰 BleachBit’s new TUI lets you clean without a desktop environment Open-source cleaning tool BleachBit has gained a text-based user interface (TUI) as an optional alternative to its standard graphical frontend. Unlike BleachBit’s existing CLI, which is intended for non-interactive use in scripts, the TUI is fully interactive, you navigate the interface with your keyboard (there’s limited mouse support) to select, preview and clean out cruft. 🔗 Source: https://www.omgubuntu.co.uk/2026/05/bleachbit-tui #opensource

Hashtags

Linuxgram 🐧

@linuxgram · Post #18795 · 14.05.2026 г., 19:31

📰 MuseScore Studio 4.7 Notation App Adds New Guitar Features MuseScore Studio 4.7 open-source notation app adds new engraving tools, guitar notation features, playback improvements, MP4 export, and more. 🔗 Source: https://linuxiac.com/musescore-studio-4-7-notation-app-adds-new-guitar-features/ #opensource

Hashtags

Linuxgram 🐧

@linuxgram · Post #18740 · 11.05.2026 г., 08:32

📰 Dusk is a reverse-engineered reimplementation of The Legend of Zelda: Twilight Princess The Legend of Zelda: Twilight Princess comes to PC thanks to a new open source reverse-engineered reimplementation called Dusk.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/05/dusk-is-a-reverse-engineered-reimplementation-of-the-legend-of-zelda-twilight-princess #opensource

Hashtags

Linuxgram 🐧

@linuxgram · Post #18739 · 11.05.2026 г., 08:06

📰 Restriced by the West, Huawei's Open Source HarmonyOS Now Powers 55 Million Devices It seems that Huawei has managed to create an ecosystem of hardware as well as software. 🔗 Source: https://feed.itsfoss.com/link/24361/17338103/harmony-os-rises-china #opensource

Hashtags

Linuxgram 🐧

@linuxgram · Post #18738 · 11.05.2026 г., 06:37

📰 Audacious 4.6 Media Player Promises File Browser Plugin, Beta Out Now Audacious 4.6 open-source media player is now available for public beta testing with a File Browser plugin, a macOS Now Playing plugin, support for playing Musepack SV8 files, and much more. 🔗 Source: https://9to5linux.com/audacious-4-6-media-player-promises-file-browser-plugin-beta-out-now #opensource

Hashtags

Linuxgram 🐧

@linuxgram · Post #18713 · 08.05.2026 г., 16:32

📰 Nintendo 64 emulator gopher64 adds controller hotkeys and auto-reconnect The free and open source Nintendo 64 emulator gopher64 has another useful new release out now, bringing a few more features to make it easier.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/05/nintendo-64-emulator-gopher64-adds-controller-hotkeys-and-auto-reconnect/ #opensource

Hashtags

Linuxgram 🐧

@linuxgram · Post #18695 · 07.05.2026 г., 07:22

📰vm2 Node.js Library Vulnerabilities Enable Sandbox Escape and Arbitrary Code Execution A dozen critical security vulnerabilities have been disclosed in the vm2 Node.js library that could be exploited by bad actors to break out of the sandbox and execute arbitrary code on susceptible systems.vm2 is an open-source library used to run untrusted JavaScript code inside a secure sandbox by intercepting and proxying JavaScript objects to prevent sandboxed code from accessing the host. 🔗 Source: https://thehackernews.com/2026/05/vm2-nodejs-library-vulnerabilities.html #opensource

Hashtags

Linuxgram 🐧

@linuxgram · Post #18693 · 06.05.2026 г., 20:34

📰Mesa 26.1 Released With Many Improvements For Open-Source Vulkan Drivers Eric Engestrom just announced another timely feature release of the Mesa drivers. Mesa 26.1 is out today for this collection of predominantly OpenGL and Vulkan drivers for a variety of hardware as well as the likes of Rusticl for OpenCL, Zink for OpenGL-on-Vulkan, various Windows acceleration components, and more... 🔗 Source: https://www.phoronix.com/news/Mesa-26.1-Released #opensource

Hashtags

Linuxgram 🐧

@linuxgram · Post #18692 · 06.05.2026 г., 17:58

📰 Inkscape 1.4.4 SVG Editor Released with a New Palette, Performance Improvements Inkscape 1.4.4 open-source SVG (Scalable Vector Graphics) editor is now available for download with a new palette, performance improvements,and bug fixes. Here’s what’s new! 🔗 Source: https://9to5linux.com/inkscape-1-4-4-svg-editor-released-with-a-new-palette-performance-improvements #opensource

Hashtags

Linuxgram 🐧

@linuxgram · Post #18674 · 05.05.2026 г., 03:41

📰 gThumb is barely recognisable in its GTK4/libadwaita port gThumb, the open-source image viewer and organiser, has been rewritten in Vala and ported to GTK4/libadwaita – and compared to the old UI, it’s barely recognisable. An alpha build of gThumb 4.0 is available for testing. Alongside the visual revamp, this brings support for WEBP and PNG animations, lets you export images in the JXL format and includes a censor filter to pixelate or blur out parts of an image. 🔗 Source: https://www.omgubuntu.co.uk/2026/05/gthumb-gtk4-port-redesign #opensource

Hashtags

Linuxgram 🐧

@linuxgram · Post #18669 · 04.05.2026 г., 17:17

📰 I tried an open-source Figma alternative, and its AI does what Figma's can't Not a Figma killer, but something more interesting. 🔗 Source: https://www.xda-developers.com/ditched-figma-for-open-source-tool-ai-does-what-figma-cant/ #opensource

Hashtags

Linuxgram 🐧

@linuxgram · Post #18663 · 03.05.2026 г., 22:06

📰 ReactOS Introduces Unified Live/Install Media, New Storage Driver ReactOS as the "open-source Windows" operating system project striving for binary compatibility with Microsoft Windows has seen some exciting improvements this week... 🔗 Source: https://www.phoronix.com/news/ReactOS-Unified-ISO #opensource

Hashtags

123•••10•••20•••30•••3738
ПретходнаСтраница 1 од 38Следна