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,232 слични објави

Пребарај: #blockchain

当前筛选 #blockchain清除筛选
producTICvidad® 📲📈

@producTICvidad · Post #537 · 05.09.2021 г., 13:12

Algo de #blockchain para empezar el día 👇🏽👇🏽 ⁠El estratega senior de Bloomberg llama a Bitcoin un activo de reserva global en camino a los USD 100,000 Tras una corrección masiva, los activos digitales liderados por Bitcoin y Ethereum están en camino de alcanzar nuevos picos, según un nuevo informe de Bloomberg https://ct.com/9wwt

Hashtags

Immunefi

@immunefi · Post #467 · 21.06.2022 г., 18:37

If you still haven’t read our ultimate guide to hacking #Blockchain, now is the perfect time to do it 🤓 Let us know what you think 💭 https://medium.com/immunefi/hacking-the-blockchain-an-ultimate-guide-4f34b33c6e8b

Hashtags

producTICvidad® 📲📈

@producTICvidad · Post #333 · 25.02.2021 г., 19:42

Para qué sirve #blockchain? En el 2020 se han presentado importantes noticias en la implementación de proyectos blockchain. Uno de los pilotos más importantes para el Foro Económico Mundial (WEF en inglés) tienen como protagonista a Colombia, en donde ya menciona los proyectos específicos para la gestión del Programa de Alimentación Escolar - PAE, en el marco de la iniciativa liderada por la Procuraduría General de la Nación, en asocio con el Centro de la Cuarta Revolución Industrial de Colombia y otros actores. Este proyecto busca mitigar la corrupción en dicho programa ofreciendo transparencia en los procesos, cuidando así los recursos públicos y el bienestar de los beneficiarios.

Hashtags

DWF Labs Broadcast

@Dwflabs · Post #32 · 15.09.2022 г., 11:06

DWF Labs is pleased to announce our strategic secondary market investment into Conflux. (https://twitter.com/Conflux_Network) Conflux is the only regulatory-compliant permissionless Layer 1 blockchain in China. The #blockchain helps to connect decentralized economies across borders and protocols. Conflux provides a fast, secure, and scalable blockchain environment through the Tree-Graph consensus algorithm. This unique consensus algorithm enables parallel processing of blocks and transactions to make the blockchain fast, secure, and scalable with low transaction fees.

Hashtags

Venom Foundation Official

@venomfoundationofficial · Post #30 · 21.02.2023 г., 14:02

Venom is happy to announce its partnership with Hacken. Venom & Hacken will join forces to increase the security around blockchain adoption. Together, we will work towards a safer and more accessible #blockchain ecosystem for everyone.

Hashtags

Repositorio data science

@repo_science · Post #3234 · 27.05.2023 г., 18:47

#python#blockchain 💰 Learn about Python and Blockchain: The Complete Guide! Blockchain technology explained. Cryptocurrency, cryptography, transactions & programming in the best Blockchain course 🗣️: Mammoth Interactive, John Bura 🔗Link ----- Main channel: @repo_science Coupons: @freecoupons_reposcience -----

TONlines – News

@tonlines · Post #7615 · 25.11.2025 г., 13:30

⚡️The Daily TON: Challenges Facing the TON Ecosystem #TON#blockchain The Daily TON highlights the closure of the SettleTON project as part of a trend of non-profitable projects within the TON ecosystem. While lesser-known projects are closing, the core functionalities remain intact. However, the situation signals an urgent need for changes to prevent further losses. Source: link @tonlines

TONlines – News

@tonlines · Post #7534 · 19.11.2025 г., 14:56

⚡️Toncoin Unveils New Documentation #TON#blockchain Toncoin has launched a completely revamped documentation site incorporating community feedback. The update includes AI assistance, simplified navigation, and comprehensive guides for various tools and concepts related to TON. Source: link @tonlines

TONlines – News

@tonlines · Post #7305 · 21.05.2025 г., 09:04

Hipo Highlights: Understanding Blockchain Nodes #blockchain#TON Hipo explains the fundamental role of nodes in blockchains like TON and Bitcoin. Nodes are crucial for maintaining decentralization and security by storing and syncing data globally. Source: link @tonlines

TONlines – News

@tonlines · Post #7301 · 20.05.2025 г., 15:37

The Daily TON: Why Technical Knowledge of TON Matters #TON#blockchain The Daily TON highlights the importance of understanding technical aspects of the TON blockchain even for regular users. Knowledge of elements like collators and technical underpinnings helps users avoid potential pitfalls and make informed decisions, underpinning their participation in the ecosystem's growth. Source: link @tonlines

123•••100•••102103
ПретходнаСтраница 1 од 103Следна