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

Резултати

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

Пребарај: #block

当前筛选 #block清除筛选
NEA Singapore

@NEASingapore · Post #803 · 31.03.2024 г., 07:19

Over 5,000 dengue cases were reported in the first quarter of 2024, more than double the 2,360 cases reported in the same period last year. Since the start of 2024, the weekly number of reported dengue cases has remained high, at above 300. There have also been 7 dengue deaths this year. Read on at https://go.gov.sg/dengue-outlook-2024 Dengue risk factors present – high Aedes mosquito population, low population immunity against the Dengue virus – may lead to a surge in dengue cases. Collective responsibility and action are critical. Here’s what you can do to prevent mosquito bites and break dengue transmission: S-A-W (especially if you are diagnosed with or suspected to be infected with dengue) ✔️Spray insecticide in dark corners around the house ✔️Apply insect repellent regularly ✔️Wear long-sleeve tops and long pants Let’s practise these #BLOCK steps at least once a week, to protect ourselves and our families from dengue. B-L-O-C-K ✔️Break up hardened soil ✔️Lift and empty flowerpot plates ✔️Overturn pails and wipe their rims ✔️Change water in vases ✔️Keep roof gutters clear and place BTI insecticide inside 📲Download the myENV app to receive alerts on high Aedes mosquito populations near you, or visit https://go.gov.sg/dengue-high-risk Areas with higher Aedes aegypti mosquito population have a higher risk of dengue and Zika transmission: https://www.nea.gov.sg/dengue-zika/Aedes

Hashtags

NEA Singapore

@NEASingapore · Post #629 · 31.08.2023 г., 23:01

#SGDengueUpdate 198 new dengue cases and 35 active dengue clusters were reported in the week ending 26 Aug 2023. Let’s actively do the #BLOCK steps: https://go.gov.sg/mozzieproof

NEA Singapore

@NEASingapore · Post #626 · 24.08.2023 г., 10:06

#SGDengueUpdate 193 new dengue cases and 41 active dengue clusters were reported in the week ending 19 Aug 2023. Let’s actively do the #BLOCK steps: https://go.gov.sg/mozzieproof

NEA Singapore

@NEASingapore · Post #624 · 17.08.2023 г., 10:14

#SGDengueUpdate 197 new dengue cases and 37 active dengue clusters were reported in the week ending 12 Aug 2023. No new Zika case was reported last week. Let’s actively do the #BLOCK steps: https://go.gov.sg/mozzieproof

NEA Singapore

@NEASingapore · Post #604 · 27.07.2023 г., 09:38

#SGDengueUpdate 202 new dengue cases and 41 active dengue clusters were reported in the week ending 22 Jul 2023. 1 new Zika case was reported. Let’s continue to actively do the #BLOCK steps: https://go.gov.sg/mozzieproof

KOMPYUTER AKADEMIYASI

@Kompyuter_akademiyasi · Post #5566 · 01.11.2023 г., 14:56

#youtube#block 📹 YouTube butun dunyo bo‘ylab foydalanuvchilar reklama blokerlaridan foydalansalar, video ko‘rishlarini taqiqlashni boshladi. ➖@texnologiyait➖

NEA Singapore

@NEASingapore · Post #694 · 26.10.2023 г., 09:00

#SGDengueUpdate 208 new dengue cases and 51 active dengue clusters were reported in the week ending 21 Oct 2023. #DidYouKnow that individuals infected with dengue are advised to avoid further mosquito bites, to prevent passing on the virus to mosquitoes and other people in the neighbourhood? They can do so by practising S-A-W. To protect ourselves and our families from dengue and Zika, it is critical that we all play our part and do the #BLOCK steps at least once a week. ⚠️ Urgent action from all is critical to prevent a surge in dengue cases at year-end. Areas with higher Aedes aegypti mosquito population have a higher risk of dengue and Zika transmission: www.nea.gov.sg/dengue-zika/Aedes

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