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

Резултати

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

Пребарај: #cryptogrowth

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

@toncoin_rap · Post #142 · 13.09.2024 г., 06:29

🎧⤴ TON Blockchain Surges to the Top: Is This the Next Crypto Revolution? The TON Blockchain has taken the crypto world by storm, becoming a leader in terms of annual transaction growth. As one of the fastest-growing blockchains, TON boasts an impressive ecosystem, driven largely by its close association with Telegram and a growing number of users across CIS and Asia. With its remarkable performance, the network outpaces major players like Bitcoin, offering unprecedented potential for Web3 adoption. The future of decentralized applications (DApps) and the crypto economy is being reshaped—TON’s rise to the top is just the beginning! Chorus: We're TON, blockchain risin', makin' moves you can't deny, Fastest on the block, watch it grow and touch the sky. Transactions flowin' like a stream, unstoppable and wide, Web3’s future’s here, we’re the ones to take the ride. Verse 1: Came from Telegram, we ain't here to play, Transactions through the roof, growin’ every day. From the CIS to Asia, crypto on display, The TON revolution’s here, no time for delay. EVM in sight, layer-2 it’s tight, Developers ridin’ with us, keepin’ it light. Bitcoin we outpace, future lookin' bright, Decentralized dreams, man, we takin' flight. Chorus: We're TON, blockchain risin', makin' moves you can't deny, Fastest on the block, watch it grow and touch the sky. Transactions flowin' like a stream, unstoppable and wide, Web3’s future’s here, we’re the ones to take the ride. Verse 2: Open League in the scene, crypto on the rise, With a cabin full of plans, takin' over the skies. Affordable tech, unlockin' minds worldwide, From DeFi to GameFi, come and join the tide. Bridges to Bitcoin, yeah, we breakin’ the mold, Ether’s on notice, TON’s gettin' bold. No airdrop games, just stories untold, It’s the mass adoption wave, come get involved. Chorus: We're TON, blockchain risin', makin' moves you can't deny, Fastest on the block, watch it grow and touch the sky. Transactions flowin' like a stream, unstoppable and wide, Web3’s future’s here, we’re the ones to take the ride. Verse 3: From the shadows we crept, now we're front page, Pushin’ out the limits, we the crypto age. Layer 1 shakin’, disruptin' the stage, Decentralized freedom, come release the cage. Partners in place, with Tether on board, Fintech’s future, where Toncoin’s adored. Validator nodes climbin', pushin' the horde, TON leads the charge, watch us soar like a sword. Chorus: We're TON, blockchain risin', makin' moves you can't deny, Fastest on the block, watch it grow and touch the sky. Transactions flowin' like a stream, unstoppable and wide, Web3’s future’s here, we’re the ones to take the ride. Bridge: Exponential growth, we keep pushin’ the limit, Cryptocurrency dreams, TON’s right in it. Block by block, code never timid, World’s watchin' now, TON’s the one to win it. #TONBlockchain #CryptoGrowth #TONCryptoNewsRapStyle 🎧@toncoin_rap

Venture Village Wall 🦄

@venturevillagewall · Post #3984 · 25.01.2025 г., 19:00

Crypto Trader Gains $1.2 Million Profit Famous trader *Cosmonaut* achieves $1.2 million profit by following whale wallets. Bought Trump token for $5-8 before surge, similar success with SHIBA, PEPE, and FLOKI, each rising over 1000% in six months. Weekly trade signals shared in his Telegram channel predict coins with x5-x10 potential for 2025. Join him here. Pantera Capital's Dan Morehead shares confidence in Bitcoin's resilience, citing ownership by 50 million Americans and institutions like BlackRock and Fidelity back it. #Crypto#Bitcoin#Trading#Profit#Investment#Whales#Tokens#Cosmonaut#SHIBA#PEPE#FLOKI#PanteraCapital#DanMorehead#Solana#Fidelity#BlackRock #2025 #MarketTrends#CryptoGrowth#Telegram

Venture Village Wall 🦄

@venturevillagewall · Post #4190 · 19.02.2025 г., 13:00

OKX Legalizes Operations in Europe OKX has obtained MiCA licensing and passported its services across the European Economic Area (EEA). Over 400 million users in 28 countries can now access fully regulated crypto services via its Malta base. Licensed entities can expand services within the EU under a unified regulatory framework. The platform offers access to over 240 crypto assets and more than 300 trading pairs, including 60+ with Euro. More details: OKX Announcement #OKX#Crypto#EU#MiCA#CryptoRegulation#Malta#Blockchain#Trading#DigitalAssets#CryptoServices#Cryptocurrency#ECC#Fintech#RegulatedCrypto#CryptoGrowth#Investing#Finance#TradingPairs#Economie#CryptoMarket#MarketTrends