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

Резултати

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

Пребарај: #uaeblockchain

当前筛选 #uaeblockchain清除筛选
TON Crypto News

@toncoin_rap · Post #197 · 03.11.2024 г., 16:54

🎧⤴ 🤑 Tether's Game-Changer: Dirham-Pegged Stablecoin Set to Launch on TON Blockchain! Tether is set to unveil a new dirham-pegged stablecoin on the TON blockchain, following its successful integration of USDT, which recently reached 1 billion tokens. This stablecoin, backed by liquid UAE reserves, aims to enhance cross-border payments and facilitate secure transactions in the UAE. Tether's partnership with Phoenix Group and Green Acorn Investments underscores the UAE's growing influence as a global cryptocurrency hub. This launch coincides with the UAE's new licensing framework for stablecoins, positioning Tether as a key player in the region's digital economy. Chorus: Tether's bringing fire with the dirham in the game, Stablecoin's the name, ain't no two the same. On the TON blockchain, watch the future ignite, Secure your transactions, everything feels right. Verse 1: In the desert where the sun shines bright, Tether’s dirham stablecoin takes flight. Backed by reserves, it’s liquid and clean, Digital dirhams, if you know what I mean. From Dubai to the world, we’re breaking the mold, Cross-border cash flows, stories to be told. With every transaction, the trust is built, A new era of finance, no room for guilt. Chorus: Tether's bringing fire with the dirham in the game, Stablecoin's the name, ain't no two the same. On the TON blockchain, watch the future ignite, Secure your transactions, everything feels right. Verse 2: Blockchain's the highway, speeding up the grind, With 160k transactions, we’re redefined. Companies on Fireblocks, joining the race, Tether’s got the vision, setting the pace. UAE's the scene, where crypto thrives, With innovation and rules, it’s where ambition arrives. From USDT’s success to the dirham's embrace, Tether’s changing the game, it’s a whole new space. Chorus: Tether's bringing fire with the dirham in the game, Stablecoin's the name, ain't no two the same. On the TON blockchain, watch the future ignite, Secure your transactions, everything feels right. Verse 3: Regulations in place, clarity to thrive, UAE's got the vision, watch the market come alive. With partners by our side, we’re aiming for the stars, Bringing trust and stability, no matter where you are. From the city of gold, the world we’ll engage, In this digital era, we’re turning the page. Tether's dirham stablecoin, a future so bright, Crypto's revolution, we're ready to ignite. Chorus: Tether's bringing fire with the dirham in the game, Stablecoin's the name, ain't no two the same. On the TON blockchain, watch the future ignite, Secure your transactions, everything feels right. Bridge: So here’s to the future, with crypto in our hands, Building a new world, making bold plans. Tether's on a mission, we’re setting the tone, In the heart of the UAE, we’re claiming our throne. #CryptoInnovation#Stablecoin#UAEBlockchain #TONCryptoNewsRapStyle 🎧@toncoin_rap