TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #205 · 22 јан.

Как работает функция reload()? Эта функция нужна для того, чтобы перезагрузить изменившийся код из py-файла без рестарта интерпретатора. Дело в том, что любой импортированный модуль при повторном импорте не будет перечитывать файл. Функция импорта вернёт уже загруженный в память объект модуля. Чтобы обновить код, нужно либо перезапустить всю программу, либо использовать функцию reload() from importlib import reload reload(my_module) 🔸 Функция reload() принимает в качестве аргумента только объект модуля или пакета. Она не может перезагрузить класс или функцию. Только весь файл целиком! 🔸 Перезагрузка пакета перезагрузит только его файл __init__.py, если он есть. Но не вложенные модули. 🔸Она не может перезагрузить ранее не импортированный модуль. 🔸При вызове функция reload() перечитывает и перекомпилирует код в файле, создавая новые объекты. После создания новых объектов перезаписывается ранее созданный неймспейс этого модуля. Это значит, что если где-то этот модуль импортирован через import и обращение к атрибутам происходит через неймспейс (имя) модуля, то такие атрибуты обновятся. Если какие-либо объекты из этого модуля импортированы через from то они будут ссылаться на старые объекты. Напишем простой модуль # mymodule.py x = 1 Теперь импортируем модуль и отдельно переменную х из модуля >>> import mymodule >>> from mymodule import x >>> print(mymodule.x) 1 >>> print(x) 1 Не перезапуская интерпретатор вносим изменения в модуль # mymodule.py x = 2 Делаем перезагрузку модуля и проверяем х ещё раз >>> reload(mymodule) >>> print(mymodule.x) 2 >>> print(x) 1 То же самое будет если присвоить любой объект переменной (даже словарь или список) Повторный импорт обновляет значение >>> from mymodule import x >>> print(x) 2 🔸Созданные инстансы классов не обновятся после перезагрузки модуля. Их придётся пересоздать. #tricks#basic

Резултати

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

Пребарај: #elevation

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

@amazingeo · Post #464 · 19.11.2025 г., 20:31

🌍 The highland climate zone, found on tall mountains and plateaus, can create pockets where tropical, temperate, and even polar conditions exist within just a few vertical kilometers. ✨ #climate⚡#elevation⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #137 · 29.08.2025 г., 09:12

🌍 Some cities, like Johannesburg, are built on high plateaus called "highveld," sitting over 1,700 meters above sea level. Their altitude shapes local climate and city life in unique ways. ✨ #urbanization⚡#elevation⚡#climate⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #501 · 08.12.2025 г., 12:31

🌍 Mount Everest isn’t Earth’s tallest mountain from base to peak—that title goes to Hawaii’s Mauna Kea, which rises over 10,000 meters from deep ocean floor to summit, out-towering Everest by far. ✨ #mountains⚡#volcanoes⚡#elevation⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #159 · 02.09.2025 г., 00:12

🌍 The tallest volcano on Earth is Mauna Kea in Hawaii. Measured from its base on the ocean floor, it rises over 10,000 meters—making it taller than Mount Everest from base to summit. ✨ #mountains⚡#volcanoes⚡#elevation⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #339 · 06.10.2025 г., 15:31

🌍 The first known use of contour lines on a map appeared in 1584, showing the depth of water in the Netherlands. This method is still used today to show elevation and terrain on modern maps. ✨ #cartography⚡#elevation⚡#history⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #52 · 15.08.2025 г., 09:12

🌍 Mount Chimborazo in Ecuador is the farthest point from Earth’s center, not Mount Everest. Its location near the Equator means it sits atop the planet’s equatorial bulge. ✨ #coordinates⚡#equator⚡#elevation⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍

Amazing Geography 🌍

@amazingeo · Post #91 · 21.08.2025 г., 20:12

🌍 Cartographers use colors on maps to represent different heights—this is called hypsometric tinting. Lighter colors usually show higher land, while darker tones indicate lower elevations. ✨ #cartography⚡#elevation⚡#colors⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍

B U B B L E H O U S E / Cheng Dong. A coherent city / Sangu Design The Human Condition by Hannah Arendt says that world is like a table that brings people together and separates people from each other. People yearn to see each other in the city; they call for a new connection which is beyond age, experience, boundaries, it also can transcend personal loneliness and urban barriers. . When the architect design and construct from the perspective of the user, they therefore are willing to respect the vitality of the building and rationally make use of the existing rules and conditions to practice the possibility of the local urban lifestyle. #facade#elevation#interior#urbanplan#geometricarchitecture#glassfacade#interiordesign#composition#modulararchitecture#building#arch_shovel

Мирослава Карпович

@m1r0slavakarpovich · Post #1252 · 03.11.2023 г., 01:11

Voulez-Vous venir au théâtre ?Avec moi? ce soir ?😁 Жизнь гастрольная💃🏻 АФИША НА НОЯБРЬ❤️‍🔥 от @moscomedytheatre💃🏼🕺🏻 (Ссылка на билеты в шапке профиля) 1-«Мастер и Маргарита» Ханты-Мансийск 2-«Мастер и Маргарита» Ханты-Мансийск 4- «Слишком женатый таксист» 16.00 /«Номер 13» 20.00 5-«Номер 13» 19.00 7- «Номер 13» Казань 19:00 10- «Номер 13» 19.00 11- «Мужчина на все руки» 17.00/ «Сказ про Федота Стрельца» 20.00 13- «Слишком женатый таксист» Омск 19.00 18-14.00 «Сказ про Федота Стрельца»/17.00 «Слишком женатый таксист» 19-«Мужчина на все руки» 19.00 25- «Слишком женатый таксист» 20.00 26-«Мастер и Маргарита» Пушкино 19.00 27- «Мастер и Маргарита» Елец 19.00 28- «Мастер и Маргарита» Орёл 19.00 29- «Мастер и Маргарита» Смоленск 19.00 30- «Мастер и Маргарита» Рославль #культурнаястолица#культурнаяжизнь#театр#московскийтеатркомедии#comedy#theatre#actress#actrice#афиша#ноябрь#ждемвас#окультуриваемся#номер13#рэйкуни#слишкомженатыйтаксист#театралы#осень#новыйсезон#moodoftheday#photography#photooftheday#elevation#гастроли#мастеримаргарита#марго#маргаританиколаевна#булгаков#рукописинегорят#petitefemme#mira

Мирослава Карпович

@m1r0slavakarpovich · Post #823 · 07.03.2023 г., 21:06

Дорогие Леди! С нашим праздником Вас!🖤 Дорогие Джентельмены, поздравляем Вас с тем, что Мы есть у Вас такие праздничные! 😂😜❤️‍🔥💡🔌🧨💣 Photobombed & reels by @hristy__ Кристюша спасибо за то,как ты умеешь видеть женщин!❤️‍🔥 MUAH by @elena__muah Леночка,спасибо!В твоих руках мы становимся Богинями!Каждая!❤️‍🔥 #8марта#спраздником#девочки#женщины#бабушкитожедевушки#нашдень#girls#girlswannahavefun#moodoftheday#photooftheday#reels#lady#actress#model#blackpink#blackdress#мирославакарпович#мира#petitefashion#womensfashion#retro#elevation#elegance#petitefemme#mira#женщинамира

Мирослава Карпович

@m1r0slavakarpovich · Post #818 · 01.03.2023 г., 06:17

С ВЕСНОЙ ВАС🤍🕊️✨ #highlevel#newchapter#goldenedition Photobombed me @hristy__🧨 Makeup & hair @elena__muah💋 #muse#яработаюмузой#actress#actrice#model#legslegslegs#elevation#higher#postcard#spring#springspringspring#springfashion#moodoftheday#photography#photooftheday#lady#mademoiselle#purelove#heavenonearth#благодарю#люблю#свеснойвас#доброеутро#petitefemme#mira#женщинамира#карповичмирослава