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

Резултати

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

Пребарај: #valentine

当前筛选 #valentine清除筛选
Everything Science

@everything_science · Post #3290 · 17.02.2025 г., 07:44

Single man in china once booked every other seat in a cinema theatre to split up couples on valentine's day. #Valentine 🔔@Everything_Science

Hashtags

🦅 [ perspective ix ]

@perspectiveix · Post #1110 · 14.02.2018 г., 20:00

​​❤️ Valentine's Day 2018 - The Cost Of Love Love it or loathe it, #Valentine's Day is an important date for the 🇺🇸 economy. According to the National Retail Federation (NRF), the average American will spend $143.56 on gifts this year, with total planned nationwide spending $19.6 billion. 55% of people are going to celebrate with jewelry ($4.7 billion), an evening out ($3.7 billion) and flowers ($2.0 billion) the top spending categories. 🚀@PerspectiveIX 🌀 ⁣http://prs.pctvix.co/TelegramIX

Hashtags

🚀 LAUNCH DAY #VALENTINE is going to enter the market. Chart’s will heating up. 📜 Contract: 0x3942B1e2F8B4B2d7921CE49A1fC0f805295F381C 💰 Tax: 3/3 🚀 Launching on 8/8 at 12:00 PM UTC ⏰ ➡️Ave on Broad ➡️Top trending booked ➡️#Valentine updated on #Dextool 🟢Chart: https://www.dexview.com/bsc/0x3942B1e2F8B4B2d7921CE49A1fC0f805295F381C ✉️Telegram https://t.me/bsc_Valentine 🐦Twitter https://x.com/bsc_Valentine

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40655 · 13.02.2026 г., 23:01

Saint Valentine’s Day, or simply Valentine’s Day, is celebrated on the 14th of February, but primarily in western societies. The day has been named after one or more martyrs of the early Christian era named Valentine or Valentinus who lived sometime in the 3rd century CE and were killed for defying oppressive laws directed either against Christians or young lovers in the Roman Empire. [read more here] @googlefactss#history#love#Valentine

APKPure_Official

@apkpurechannel · Post #2873 · 21.02.2026 г., 11:31

🔥💗Grow a Garden #Valentine Part 2 Event 👀#Leak 🚀💘Feb 22 - Mar 1 💕💕More Hearts!! Expect a huge variety of new Valentine's-themed cosmetics In the Valentine's part 2 update! With all these new features, you'll create heart-filled gardens, plus a brand-new quality-of-life update for the Heart Blossom Seed and much more in Grow a Garden! 💕💕💕 #gag#trade🌞#growagarden❤️#valentine🐝#garden 📅🎁Check out GAG Giant pet giveaways on TradeKitsune. Add @APKFreeDownloader_Bot to get any apk you want.

Kraze magazine Instagram Update Vogue Korea has released its February 2026 issue with Jimin as the main cover star. This edition, released in February, carries a Valentine’s theme and features a visual concept highlighting Jimin’s artistic character and personal identity. After Vogue published the February 2026 cover, Jimin ranked number one in global trending topics. Follow @kraze.official for daily and reliable updates on K-pop news, trends, events, and everything in between! 💌 [email protected] Source: Vogue Korea #Jimin#BTS#Vogue#VogueKorea#Valentine -@All_BTS_Updates