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

Резултати

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

Пребарај: #pets

当前筛选 #pets清除筛选

🐹 Беговое колесо хомячка Занимательная игрушка для вашего питомца! Вращающееся беговое колесо отлично подойдет любому активному грызуну. Легко распечатывается на 3D-принтере! 🔗Скачать:Printables #️⃣ Категория:#Pets@anzar3d 🖨3D модели | Max

Hashtags

🐱 Выжиматор кошачьего корма – экологично, чисто и удобно! Это удобное устройство поможет оставить руки чистыми от влажного корма и сделает кормление кошек проще! Без отходов, легко моется, быстро печатается на 3D-принтере! 🔗Скачать:Printables #️⃣ Категория:#Pets@anzar3d 🖨3D модели для печати | 3D Маркетплейс | Max

Hashtags

TONlines – News

@tonlines · Post #6736 · 12.04.2025 г., 14:13

Hamster Kombat Announcement: Celebrate International Hamster Day! #hamster#pets Hamster Kombat Announcement highlights International Hamster Day on April 12, a day to celebrate these adorable pets with treats and affection. Join in the tradition and make your hamster feel extra special. Source: link @tonlines

Reuters: World

@reutersworldchannel · Post #149448 · 16.10.2021 г., 09:27

Furry friends receive blessings at Peru monastery Animal lovers in Lima, Peru, had their pets blessed during a special mass for their four-legged friends at the Saint Francis Monastery. #News#Reuters#Pets#Peru Subscribe: http://smarturl.it/reuterssubscribe Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled. Get the latest news on: http://reuters.com/ Follow Reuters on Facebook: https://www.facebook.com/Reuters Follow Reuters on Twitter: https://twitter.com/Reuters Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en ➖@reutersworldchannel➖

探索号

@seeker_rc · Post #19890 · 07.05.2026 г., 13:55

[开源自荐] 下蛋 / XiaDown 更新了:兼容 Codex Pets,界面统一,转 MP3 自动写入封面 大家好,我是 Arnold ,下蛋 / XiaDown 的作者。 上周在 V2EX 自荐过这个项目:一款基于 Wails 3 开发的跨平台桌面工具,是一款在线音乐播放器,也是一款视频下载工具。 项目地址: GitHub: <https://github.com/arnoldhao/xiadown> 官网: <https://xiadown.dreamapp.cc/> ✏ 这次更新了什么 这周做了一版更新,主要有三个变化。 ✏ 兼容 Codex Pets 最近 Codex 发布了 Pets ,社区里很快出现了不少宠物分享站。XiaDown 原本就有精灵和动作系统,和 Codex... via V2EX 分享创造 标签: #XiaDown#Codex#Pets ⚡️探索号频道 ⚡️探索者频道 ⚡️探索者交流群 ⚡️ Youtube 频道:科技探索者 每天推荐有趣内容,欢迎订阅、转发。

Venture Village Wall 🦄

@venturevillagewall · Post #3492 · 19.12.2024 г., 13:58

Nest Veterinary Secures $700K Funding Nest Veterinary has successfully raised $700,000 in funding to support its innovative platform that enables users to create and manage customized wellness plans for pets. This funding round took place on December 16, 2024. For more details, visit Nest Veterinary. #Veterinary#Funding#WellnessPlans#Pets#Startup

International News

@intnewsagency · Post #9407 · 28.04.2026 г., 17:40

Russia Proposes Unified Pet Registry The St. Petersburg Legislative Assembly has initiated a bill to create a unified registry for pets, requiring mandatory registration and tagging. The draft law is now in the State Duma. Owners must register their animals, aiding quick recovery if lost and identifying owners in case of damage. The government will approve which animals must be registered. A similar proposal led by deputy Nina Ostanina previously gained committee support. #Russia#pets#registry#law#StateDuma The main news of Russia and the world ishere.

Tg Links

@TgDict · Post #210 · 01.11.2023 г., 16:07

#animal#pets#cat#dog utucutie tg://resolve?domain=utcutie wonder animal tg://resolve?domain=wonderfulanimalworld bulldog tg://resolve?domain=englishbulldogshop imas tg://addstickers?set=d_imas ball Python tg://resolve?domain=ballpythonsworld Moody cats tg://addstickers?set=moodycatspack fighting tg://resolve?domain=animal_fighting animal planet tg://resolve?domain=animals_101 cat tg://resolve?domain=pussy_cat_kitten PET tg://resolve?domain=petspicsvideos house cat tg://resolve?domain=housescat cat milk tg://addstickers?set=catmilkacat pishiinamood tg://addstickers?set=pishiinamood daily cats tg://resolve?domain=daily_cats fluffypups tg://resolve?domain=fluffypups paws tg://resolve?domain=paws_home cat sticker tg://addstickers?set=s_l_6 dog Paradise tg://resolve?domain=canineparadiseth cat tube tg://resolve?domain=cat_tube living ocean tg://resolve?domain=livingocean wildlifen tg://resolve?domain=wildlifen broken cats tg://addstickers?set=brokencats beautiful hedgeogs tg://resolve?domain=hedgehogsbeauty dogs and nobe tg://resolve?domain=dogdata Nature tg://resolve?domain=animals_nature

Reuters: World

@reutersworldchannel · Post #149223 · 11.10.2021 г., 16:28

Slideshow: Drive-through pet blessing Hundreds of animal lovers in the Philippines had their pets blessed via a drive-through ceremony. #News#Reuters#Drivethrough#pets#blessing#slideshow Subscribe: http://smarturl.it/reuterssubscribe Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled. Get the latest news on: http://reuters.com/ Follow Reuters on Facebook: https://www.facebook.com/Reuters Follow Reuters on Twitter: https://twitter.com/Reuters Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en ➖@reutersworldchannel➖

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40733 · 04.03.2026 г., 07:04

Jumping spiders are small spiders in the Salticidae family. They have four pairs of eyes, with large front eyes for hunting and navigation. They do not build webs to catch prey. They hunt by stalking and leaping on insects. They use silk as a safety line when they jump. Some species are kept as pets and are easy to care for. 🕷️🌿🎯 [Read more] @googlefactss #Spiders#JumpingSpider#Salticidae#Nature#Pets

12
ПретходнаСтраница 1 од 2Следна