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

Резултати

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

Пребарај: #feed

当前筛选 #feed清除筛选
News and Tips

@NEWS_AND_TIPS · Post #2361 · 26.05.2024 г., 17:07

Hashtags Telegram #feed lite 😂😂😂 Tap on any hashtags : public posts : show as chat : congratulations you unlocked Telegram Feeds

Hashtags

☀️Beck’s☀️

@beck_blog · Post #1582 · 22.03.2021 г., 21:05

· · •🌼• · GRIDS DE INSTAGRAM · •🌼• · · En el ambiente de marketing actual de Instagram, tener una hermoso grid de Instagram es vital para el éxito de cualquier persona influyente, marca creativa o publicación. Después de todo, tu grid es la cara de tu marca; es lo primero que la gente ve cuando carga tu página de Instagram en su teléfono, tableta o computadora antes de decidir seguirte. Pero ¿que hace que un grid de Instagram sea bueno? A continuación te doy algunos consejos para conseguirlo. #tips_instagram#feed · · • • • • • · · · · • • • 🍃• • • · · · · • • • • • · ·

☀️Beck’s☀️

@beck_blog · Post #1334 · 13.02.2021 г., 14:05

· • •❄️• · GRIDS DE INSTAGRAM · •❄️• • · Hoy les hablaré de la tendencia que se gestó en Instagram de personalizar el feed de marcas y usuarios al estilo collage. Al efecto grilla que se logra en el feed con esta práctica se le llama Instagram grid layouts, rompecabezas o mosaicos. #tips_instagram#feed · · • • • • • · · · · • • • ☃️• • • · · · · • • • • • · ·

BotsGram®

@botsgram_cu · Post #4878 · 23.09.2022 г., 03:53

¿Que puede hacer este bot? @feedlio_bot Bot: fuente de noticias personal gratuita: agregue enlaces a canales interesantes y obtenga todas las publicaciones en un chat. Todos los demás canales se pueden archivar descargando la lista de diálogos. Lo que este bot puede hacer: - Sigue los canales que te interesen - Enviar todas las publicaciones nuevas a este chat. - Ahorre tiempo buscando canales entre chats personales y de trabajo #feed#canales#Seguir Idioma: Ruso ( Visto en: @BotsGram_Cu )

djangoproject

@djangoproject · Post #429 · 30.08.2017 г., 18:28

https://docs.djangoproject.com/en/1.11/ref/contrib/syndication/ The syndication #feed framework #Django comes with a high-level syndication-feed-generating framework that makes creating #RSS and #Atom feeds easy. To create any syndication feed, all you have to do is write a short Python class. You can create as many feeds as you want. Django also comes with a lower-level feed-generating API. Use this if you want to generate feeds outside of a Web context, or in some other lower-level way.

News and Tips

@NewsAndTipsNT · Post #3544 · 06.08.2025 г., 11:18

🔎Telegram May Be Quietly Testing a Feed like Feature Telegram has recently introduced a new ‘Posts’ tab in Search, allowing users to easily discover content from public channels. This update comes roughly a year after the launch of #hashtagsearch, signaling Telegram’s continued focus on improving content discoverability. This appears to be a soft launch of a potential future ‘Feed’ feature — offering users a scrollable stream of relevant #posts, possibly influenced by engagement metrics such as stars. If fully implemented, this feature could significantly boost post visibility for channels, increase ad exposure for advertisers, and enhance ad revenue opportunities for creators. All indications suggest that Telegram is gearing up to roll out a #feed-based content experience, a move that could reshape how users browse and interact on the platform.

BotsGram®

@botsgram_cu · Post #3745 · 31.03.2021 г., 14:04

¿Que puede hacer este bot? @WithqutRSSBot Este bot le permite mantenerse actualizado sobre las fuentes web que ingresó (RSS o Atom) Idioma: inglés (Visto en @botsgram_cu) #rss#feed#atom

Graph Messenger

@graphmessenger · Post #446 · 22.06.2024 г., 12:58

📄Timeline, a place where you can see all the messages from all subscribed channels. ❤️Redesigned In version 11.10.0 on June 20, 2024. 🗓Was added in version 5.0 on August 19, 2016. #features#message#timeline#feed #graph_messenger#telegram @GraphMessenger @GraphMessengerTips

News and Tips

@NEWS_AND_TIPS · Post #2363 · 26.05.2024 г., 18:19

About the recent update and future of Telegram. Based on recent updates and codes, we strongly believe that Telegram is moving in a direction similar to Twitter's. They introduced hashtag-based search/feed, which we anticipate will later evolve into a full-fledged news feed. Hashtags are also highly valuable for training AI algorithms. Furthermore, based on recent code developments, Telegram is working ona fact-checking feature, which we believe is inspired by Twitter's community notes. This tool is one of the most powerful on Twitter, and I respect and find it useful. Therefore, I consider this move by Telegram to be smart and powerful. #Hashtags#Feed#Future#Thoughts

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