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

Резултати

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

Пребарај: #hazards

当前筛选 #hazards清除筛选
Amazing Geography 🌍

@amazingeo · Post #396 · 20.10.2025 г., 18:31

🌍 A single volcanic eruption can inject millions of tons of ash into the stratosphere, blocking sunlight and cooling global temperatures for months or even years after the disaster. ✨ #volcanoes⚡#climate⚡#hazards⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #390 · 19.10.2025 г., 12:31

🌍 Mount Rainier in the United States is an active volcano capped with glaciers. Its ice stores enough water that a single eruption could trigger sudden, dangerous floods far downstream. ✨ #mountains⚡#volcanoes⚡#hazards⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #586 · 22.01.2026 г., 12:31

🌍 Supercooled rain falls when liquid droplets stay below freezing but don’t turn to ice until they hit a surface. This rare weather event can glaze roads and trees in dangerous, clear ice. ✨ #meteorology⚡#precipitation⚡#hazards⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #425 · 14.10.2025 г., 22:21

🪐 Asteroid (2015) BN509, a giant space rock measuring about 200 meters wide and 400 meters long, speeds past Earth with a shape resembling a giant peanut. Its close flyby in 2017 brought it within just 14 times the distance to the Moon, and radar imaging revealed its rapid rotation and elongated, tumbling motion—features that could make its path unpredictable if nudged by gravity. ✨ #asteroids⚡#hazards⚡#space⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #184 · 24.08.2025 г., 20:11

🪐 The asteroid (29075) 1950 DA stands out not only for its size but for its unique structure—it’s held together mostly by the tiny forces between individual grains, known as van der Waals forces, rather than by its own gravity. This means that if 1950 DA ever impacted Earth, its loosely-bound material could break apart differently than a solid rock, making its potential effects more unpredictable compared to typical asteroids. ✨ #asteroids⚡#hazards⚡#space⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #77 · 04.08.2025 г., 00:11

🪐 The asteroid 1950 DA, about 1 kilometer wide, is hurtling through space with an orbit that brings it close to Earth every few decades. Scientists monitor it closely because its surface is so loosely held together by gravity that only tiny forces—like sunlight pressure—keep it from flying apart, making it a uniquely fragile but potentially dangerous near-Earth object. ✨ #asteroids⚡#hazards⚡#space⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos 👉subscribe Universe Mysteries

Amazing Geography 🌍

@amazingeo · Post #433 · 04.11.2025 г., 12:31

🌍 Earthquakes under the ocean can create tsunamis—giant waves traveling at jet speed. A tsunami may cross an entire ocean before reaching land with just minutes’ warning. ✨ #tsunami⚡#earthquake⚡#hazards⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #759 · 04.05.2026 г., 22:21

🪐 Asteroid (1862) Apollo is one of the first discovered "Apollo-type" near-Earth asteroids, regularly crossing Earth's orbit on its journey around the Sun. Measuring about 1.5 kilometers wide, Apollo's path is closely monitored because its changing orbit brings it close enough to qualify as potentially hazardous—a reminder of why astronomers track even ancient space rocks to protect our planet from unexpected encounters. ✨ #asteroids⚡#hazards⚡#monitoring⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #703 · 06.03.2026 г., 22:21

🪐 In 2013, the small asteroid 2012 DA14, about 30 meters wide, passed just 27,700 kilometers above Earth—closer than many weather satellites. Unlike much larger objects, even an asteroid this size could cause massive regional destruction if it ever struck, which is why astronomers keep careful watch for these smaller, fast-moving near-Earth objects. ✨ #asteroids⚡#hazards⚡#monitoring⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #640 · 25.01.2026 г., 22:21

🪐 Asteroid (2015) BP513 is a near-Earth object discovered in 2015, which measures around 440 meters across and has an orbit that occasionally brings it within a few lunar distances of our planet. While it poses no immediate threat, its path is tracked closely by astronomers, since an object of this size could cause severe regional damage if it ever collided with Earth—a reminder of why the study and monitoring of such asteroids are vital for planetary defense. ✨ #asteroids⚡#hazards⚡#monitoring⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #619 · 13.01.2026 г., 12:21

🪐 Asteroid (86039) 1999 NC43 is a massive near-Earth object more than 2 kilometers wide that follows a path bringing it close to our planet's orbit. Its size means that if it ever collided with Earth, it could cause planet-wide devastation, so astronomers keep a careful watch on its movements using radar to track any changes in its trajectory. ✨ #asteroids⚡#hazards⚡#monitoring⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #557 · 14.12.2025 г., 12:21

🪐 The asteroid (99942) Apophis isn’t the only space object that often makes headlines for threatening Earth—asteroid (4450) Pan crosses our planet's orbit several times each century and is classified as a "potentially hazardous asteroid." Pan is about 1.1 kilometers wide, and astronomers regularly track its path for any minor changes that could bring it closer, since an object of this size could cause widespread destruction if a collision ever occurred. ✨ #asteroids⚡#hazards⚡#monitoring⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

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