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

Резултати

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

Пребарај: #token

当前筛选 #token清除筛选
American Crypto©

@americancryptotrading · Post #27367 · 07.09.2025 г., 08:42

🇺🇸#TOKEN/USDT is testing the supportzone on the daily chart💁‍♂️ Strong upside potential on a bounce✈️ American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27150 · 10.02.2025 г., 12:47

🇺🇸#TOKEN/USDT is bouncing from the supportzone on the 3D timeframe🧐 Looking for a rise🐃 American Crypto©

Hashtags

Airdrop Presents 🗽

@airdrop_presents · Post #2082 · 07.12.2022 г., 16:52

🪂New airdrop: Smart Link Solution (SLS) 💰 Reward: 100,000 #token ($15,000) prize pool 👥 Referral: +1 Entries 🕰 Distribution: 1st January, 2023 🔗Airdrop Link:https://wn.nr/fgmdnH -Complete all tasks of the airdrop -Complete all tasks of the airdrop Done ✅Done✅Done✅Done✅ ⚠️Please remember: Only participate in completely free airdrops, never spend any penny for airdrop tokens

Hashtags

Airdrop Presents 🗽

@airdrop_presents · Post #1652 · 01.07.2022 г., 14:14

💧Airdrop : Naga Alpha Test💧 📣Complete Task: ➕ $5000 - IDO #token Price $0.01 📊Referral : 50 Top referrers will jave a whitelist details. 🏆Winners: 250 Player Lucky random have gift token, Nft game up to 5000$ 📅End date: 3th July 2022 💎Ratings: ⭐️⭐️⭐️ 🔛Naga Alpha Airdrop For Click 🔛 🌀 Follow Naga Alpha on Twitter and retweet the pinned post. 🌀 Follow Naga Alpha on Facebook 🌀 Enter Your Gmail 🌀 Submit Bep-20 address 📡 Enter your information to the airdrop bot. 🗞Note: All airdrop steps should be completed. 👨‍💼Business Inquiry: Admin || Admin2

Hashtags

Crypto GALAXY

@crypto_galaxy_signals · Post #1490 · 17.05.2024 г., 10:10

Coin: #TOKEN/USDT Direction: LONG Leverage: 10x - Cross - TAKE-PROFIT: 1 - 0,09847 ✔️ 2 - 0,10042 ✔️ 3 - 0,10237 ✔️ 4 - 0,10725 ✔️ 🔥 Profit: 101.69% 🔥 VIP 👉t.me/cryptoxadmin

Hashtags

SingSing Announcement

@singsingchannel · Post #958 · 03.11.2024 г., 00:32

We're eagerly counting down to Nov 11 for the IDO of the $SING token! Check out this handy $SING #token IDO Cheat Sheet below for all the essential info you need to know👇 🔸Total Supply: 2.4B 🔸IDO Price: $0.018 🔸Allocation: 11.11M (0.46% Total Supply) 🔸IDO Date: Nov 11, 2024 🔸Network: BSC, ARB, POLYGON 🔸Currency: USDT 🔸Terms: 20% at TGE, then linearly monthly vesting for the next 6 months 🔸LaunchPad:@Kommunitas - details 🎤Announcement | Chat | X (Twitter) | Website | Game

Hashtags

SingSing Announcement

@singsingchannel · Post #942 · 28.10.2024 г., 13:31

🎉 Exciting Announcement! 🎉 Mark your calendars for Nov 11, 2024,when the $SING Token Sale begins on the @Kommunitas launchpad! 🔗 Check out the project on Kommunitas platform here: https://launchpad.kommunitas.net/pool/SING/PublicCross 🧵 Dive into the X thread for essential details about the upcoming #token sale! 🎤Announcement | Chat | X (Twitter) | Website | Game

Hashtags

Venom Foundation Official

@venomfoundationofficial · Post #5 · 14.10.2022 г., 07:35

Venom Foundation explicitly states that by any means not going to do any kind of a #token pre-sale (private or public) or any other form of equity allocation. More in our statement ➡️ https://medium.com/@venom.foundation/mportant-venom-foundation-does-not-distribute-venom-utility-tokens-prior-to-the-official-launch-b3ffe84326f9

Hashtags

TONlines – News

@tonlines · Post #7253 · 17.05.2025 г., 16:26

⚡️Gatto Official Channel: Major Milestone with GTON Token Burn #GTON#token The Gatto Official Channel announces that the total burn of $GTON tokens has reached 1,000,000, effectively removing 5% of the supply from circulation. This community-driven effort strengthens the token's value and stability. Source: link @tonlines

Hashtags

TONlines – News

@tonlines · Post #7683 · 02.12.2025 г., 15:03

Gatto Official Channel: December Staking Begins #staking#token The Gatto Official Channel announces the start of the December staking period after taking the first snapshot of game balances. Staking will conclude on December 29th, and token holders should maintain their balances to receive rewards. Balance cuts will occur randomly each day. Source: link @tonlines

123•••67
ПретходнаСтраница 1 од 7Следна