@QuietWorld · Post #7006 · 30.11.2019 г., 10:15
“The wisdom of life consists in the elimination of non-essentials.” 🍃 Lin Yu Tang #wisdom#life#simplicity @quietworld🍃
Hashtags
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
Пребарај: #simplicity
@QuietWorld · Post #7006 · 30.11.2019 г., 10:15
“The wisdom of life consists in the elimination of non-essentials.” 🍃 Lin Yu Tang #wisdom#life#simplicity @quietworld🍃
Hashtags
@QuietWorld · Post #7238 · 29.03.2020 г., 08:12
In a world that is so busy and craves a lot of attention, I'm just here to remind myself of something that I agree with; “simplicity is the essence of happiness”. A Simple Yet Rewarding Life Life is simple. The wisdom of life consists in the elimination of non-essentials. Fewer possessions = more time to spend enjoying life; because we are not worrying about how to pay for our possessions. Sure it is exciting to buy & bring home lots of stuffs like the latest electronic gadget but after a while, the excitement wears off anyway 🤷🏻♀ & here's a reminder in case we forgot; our self-worth is not measured by the material thing we possess. In fact, possessions often end up weighing us down – with them, come responsibility, guilt and stress. For example; your expensive car eats large chunk of your salary from the monthly instalments, insurance, services and road tax as well as the gas and repairment fees (if any)! You must hold on to your job to maintain your car as if you are a slave to it. “The things that we own, end up owning us.” The feeling of guilt comes when you feel that you have overpaid for something or should not have bought it in the first place. For example; tread mill or any other exercise machine 🙍🏻♀ Needless to say, stress will come from paying high price for it & worrying about losing them; either by them being broken or stolen. What more is needed to say? Simpler life = doing much with less. 😊 #simplicity#life#minimalism#minimalist#happiness @quietworld🍃
@lunaeverly · Post #73 · 05.02.2026 г., 08:28
A mini picnic in the park. 🧺 Just being here and now is the best plan for the day. Мини-пикник в парке. 🧺 Просто быть здесь и сейчас — лучший план на день. #LunaEverly#Picnic#DayMindset#Park#Simplicity