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

Резултати

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

Пребарај: #interstellar

当前筛选 #interstellar清除筛选
SeeYoUzbekistan

@seeyouzbekistan · Post #34 · 22.02.2025 г., 13:17

⚡️Soat 19:00 da Premyera, YouTube kanalimizga obuna bo'lib qo'ying! Kanal: 👉https://www.youtube.com/@SEEYOUZBEKISTAN/videos #QuyoshPechi#Interstellar @seeyouzbekistan • O’zbekistonni biz bilan kashf eting!

Interesting Planet 🌍

@interesting_planet_facts · Post #946 · 21.10.2025 г., 20:11

🌎 Exploring the edge of the solar system, NASA’s Voyager 1 spacecraft became the first human-made object to enter interstellar space in 2012. It carries instruments to measure cosmic rays, magnetic fields, and particles beyond the Sun’s influence—data still transmitted from over 24 billion kilometers away. ✨ #space⚡#voyager⚡#interstellar 👉subscribe Interesting Planet 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #435 · 16.10.2025 г., 22:21

🪐 Some of the most mysterious worlds in our galaxy are rogue planets like CFBDSIR J214947.2-040308.9, a giant planet drifting alone in interstellar space without a star to orbit. Detected about 130 light-years from Earth, this lonely world glows with leftover heat from its birth and is studied in infrared light, revealing that even without a sun, planets can wander the dark, silent stretches between stars. ✨ #rogueplanets⚡#interstellar⚡#giantplanets⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #416 · 13.10.2025 г., 12:21

🪐 The interstellar probe mission concept led by NASA aims to send a spacecraft beyond our solar system, much farther than Voyager 1, to distances over 1,000 astronomical units (AU) from the Sun. This ambitious plan would explore the uncharted space between stars and gather data about the outer regions of our solar system and the nearby interstellar environment, including the edge where the solar wind from our Sun blends into the thin gas found between stars. ✨ #interstellar⚡#travel⚡#NASA⚡#exploration⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #423 · 14.10.2025 г., 18:21

🪐 In 1977, the Voyager 2 spacecraft was launched carrying a special message for any potential alien civilizations—a Golden Record encoded with music, greetings in 55 languages, and sounds from Earth. Voyager 2 is now over 20 billion kilometers from our planet, traveling beyond the edge of the solar system and continuing its silent journey through interstellar space. ✨ #aliens⚡#voyager⚡#interstellar⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #327 · 25.09.2025 г., 15:21

🪐 In 1977, the Voyager 1 spacecraft left Earth carrying a "Golden Record"—a carefully crafted message with sounds and images from our planet, designed in the hope that someday it might be found by aliens in another star system. Now Voyager 1 is more than 24 billion kilometers away, continuing its silent journey through interstellar space, making it humanity’s most distant attempt to reach out to any extraterrestrial civilization. ✨ #aliens⚡#voyager⚡#interstellar⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #721 · 24.03.2026 г., 22:21

🪐 NASA and ESA are collaborating on future missions to develop solar sail technology—a method that harnesses sunlight for propulsion—to power lightweight spacecraft toward nearby stars like Alpha Centauri. Unlike rockets, solar sails use the gentle push of photons (tiny particles of light) from the Sun to gradually accelerate, making it possible for small probes to reach interstellar space without carrying any fuel onboard. ✨ #spaceships⚡#interstellar⚡#solar⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #436 · 17.10.2025 г., 12:21

🪐 The future of interstellar travel could be shaped by the use of atomic clocks and navigation systems like NASA's Deep Space Atomic Clock, tested aboard the Earth-orbiting DSAC mission. Ultra-precise atomic clocks allow spacecraft to autonomously navigate across billions of kilometers, setting the stage for robotic probes to travel to distant stars such as Alpha Centauri and safely communicate their position back to Earth. ✨ #interstellar⚡#technology⚡#navigation⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

科技&趣闻&杂记

@kejiqu · Post #4097 · 25.01.2026 г., 05:14

我们能否将蜜蜂作为智能外星生命的模型,以发展星际通信? 科学家们正在探索利用蜜蜂作为智能外星生命模型的可能性,以促进星际通信的研究。这一设想源于对宇宙中是否存在其他生命形式的长期疑问。研究人员希望通过分析蜜蜂的复杂社会行为和通信方式,为理解潜在的外星智慧提供新的视角,这一方向引发了科学界的广泛关注。Space.com 🏷#bees#interstellar#communication#AI 📢频道👥群组📝投稿

Universe Mysteries 🪐

@cosmomyst · Post #367 · 03.10.2025 г., 15:21

🪐 The future of interstellar travel could be shaped by experiments like NASA's Heliospheric Imager, which studies the vast region where the Sun's solar wind meets interstellar space—the heliopause. By understanding this distant boundary zone, where Voyager 1 crossed over 120 astronomical units from the Sun, scientists are learning how future spacecraft might navigate safely beyond our solar system and toward other stars like Alpha Centauri. ✨ #interstellar⚡#heliopause⚡#voyager⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

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