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

Резултати

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

Пребарај: #goodness

当前筛选 #goodness清除筛选
EKOLOG.UZ| ENG

@ekologuzenglish · Post #10069 · 24.10.2025 г., 12:02

🐾🔥 The Story of Scarlett — The Mother Cat Who Rushed Into Fire to Save Her Babies 💔🐱 Sometimes, true heroism doesn’t come from people, but from those who love unconditionally. 💖 This is how the world learned about Scarlett, a brave cat who, back in 1996, did something incredible — she ran five times into a burning garage to save her kittens. 🏚 It happened in one of the old garages in Brooklyn, New York, where Scarlett lived quietly with her kittens. But on the night of March 30, someone set the building on fire. Flames spread instantly, filling the place with smoke and unbearable heat. When the firefighters 🚒 arrived, they were stunned: they saw a cat running into the fire again and again, disappearing in the flames and coming out each time with a kitten in her mouth 🐈‍⬛🐈🐈‍⬛🐈🐈‍⬛ She carefully placed each baby in a safe spot, and despite the pain and fear, she rushed back into the fire to rescue the next one. 🔥 Each time she came out, she was weaker. Her fur was scorched, her ears and whiskers were burned, her paws were raw and blistered, and her eyes clouded from the heat… 😿 But she could only carry one kitten at a time, so she had no choice but to keep going. When the last, fifth kitten was finally safe, the now-blind Scarlett touched each baby with her nose, making sure all were alive ❤️ Only then did she collapse, unconscious… Deeply moved by her bravery, the firefighters rushed her and the kittens to a veterinary clinic 🏥 There, the vets treated and nursed them back to health. The story quickly made it into the New York Post 📰 — and it touched hearts all around the world. People sent letters, donations, and offers to adopt the little feline family. 😺 The kittens were soon adopted into loving homes. As for Scarlett, after recovering, she was adopted by a kind woman named Karen Wellen ❤️ In an interview, Karen said: “I will care for her as if she were my own child.” And she kept her promise 🙏 Scarlett lived 13 more happy years with Karen, never again knowing fear, pain, or hunger. Sometimes she would tremble in her sleep — as if remembering the fire — but she was always surrounded by love and safety. 🌷 🐾 Scarlett’s story became a symbol of motherly love, devotion, and courage. The media called her “Cat of the Century”, and millions of people around the world saw in her a reminder that even the smallest heart is capable of the greatest heroism 💫 💚 Let this story remind us all: Love is the power that can conquer even fire. 🔥 👇 ☘️ Read more inspiring stories and ecological news on @ekologuz 💌 Share your stories and suggestions through @eklguz_bot #ecology#animals#goodness#hero#ScarlettTheCat#ecologuz#animalheroes#love#motherhero🐾💚

Семеновский vs. Semenovskiy

@igor_semenovskiy · Post #3333 · 29.08.2025 г., 15:36

Вот и лето прошло, Словно и не бывало. На пригреве тепло. Только этого мало. . Всё, что сбыться могло, Мне, как лист пятипалый, Прямо в руки легло. Только этого мало. . Понапрасну ни зло, Ни добро не пропало, Всё горело светло. Только этого мало. . Жизнь брала под крыло, Берегла и спасала. Мне и вправду везло. Только этого мало. . Листьев не обожгло, Веток не обломало... День промыт, как стекло. Только этого мало. . Арсений Тарковский, 1967 г. . #лето#тепло#солнце#поэзия#стихи#творчество#искусство#добро#друзья#люьовь#прогулки#Москва#Зарядье#будущее#осень #summer#warm#sun#poetry#creativity#art#goodness#friends#love#walks#Moscow#Zaryadye#future#autumn