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

Резултати

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

Пребарај: #proximacentauri

当前筛选 #proximacentauri清除筛选
Universe Mysteries 🪐

@cosmomyst · Post #76 · 03.08.2025 г., 20:11

🪐 Scientists using the Green Bank Telescope detected a persistent radio signal from Proxima Centauri, the closest star to our Sun, sparking interest due to its unusual nature. Although later studies found the signal was most likely caused by human technology, Proxima Centauri remains a key target in the search for alien life because it hosts the potentially habitable planet Proxima b. ✨ #aliens⚡#exoplanets⚡#proximacentauri⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries

Universe Mysteries 🪐

@cosmomyst · Post #757 · 01.05.2026 г., 22:21

🪐 The SETI Institute's ongoing Breakthrough Listen project regularly targets the region around the star Proxima Centauri—our solar system’s closest neighbor—searching for unusual radio signals that could hint at alien technology. By scanning billions of radio frequencies from Proxima Centauri and other nearby stars, scientists are using real astronomy to explore whether advanced extraterrestrial civilizations might exist within our interstellar neighborhood. ✨ #aliens⚡#ProximaCentauri⚡#SETI⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #304 · 20.09.2025 г., 19:21

🪐 The future of interstellar travel may hinge on new propulsion ideas being studied today, like nuclear electric propulsion—which uses nuclear reactors to generate electricity for ultra-efficient ion engines. NASA has tested this kind of technology in missions like Deep Space 1, and scientists hope that one day, such systems could send spacecraft toward distant stars like Proxima Centauri far faster than chemical rockets ever could. ✨ #spaceships⚡#propulsion⚡#ProximaCentauri⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #653 · 01.02.2026 г., 12:21

🪐 Scientists are investigating laser-driven spacecraft, where powerful laser beams from Earth could propel tiny probes at speeds up to 20% that of light—fast enough to reach Proxima Centauri, our closest neighboring star system, in just over 20 years. This approach, known as "light sail" propulsion, uses intense light pressure against a thin, reflective sail to accelerate a probe, offering a glimpse of how interstellar journeys could become possible within a human lifetime. ✨ #spaceships⚡#ProximaCentauri⚡#lightsail⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #334 · 26.09.2025 г., 20:21

🪐 The challenge of reaching other star systems like Proxima Centauri, over 4 light-years away, drives scientists to explore futuristic spaceship concepts beyond anything in use today. One promising idea is fusion propulsion, which would harness the power of fusing atomic nuclei—just like in the Sun—to generate immense thrust, potentially making journeys to nearby stars possible in a matter of decades rather than millennia. ✨ #fusion⚡#propulsion⚡#spaceships⚡#ProximaCentauri⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​