@QuietWorld · Post #6982 · 26.11.2019 г., 17:13
multiply grateful for God's love, because your caution only guarantees 0, so% of your safety every day #realtalk@quietworld
Hashtags
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
Пребарај: #realtalk
@QuietWorld · Post #6982 · 26.11.2019 г., 17:13
multiply grateful for God's love, because your caution only guarantees 0, so% of your safety every day #realtalk@quietworld
Hashtags
@QuietWorld · Post #6438 · 06.05.2019 г., 09:55
💯 #realtalk#life@quietworld🍃
@QuietWorld · Post #6383 · 19.04.2019 г., 14:58
this 💯👌 if you want to apologize, just say sorry and mean it. no need to add anything to make the other person feel bad for being frustated when you are the one who hurt them. #realtalk#quotes@quietworld🍃
@QuietWorld · Post #6972 · 25.11.2019 г., 12:53
"Sometimes life doesn't give you what you want, not because you don't deserve it, but because you deserve so much more." #realtalk#motivation@quietworld
Hashtags
@QuietWorld · Post #6991 · 29.11.2019 г., 12:28
"Goodbye is only for those who like their eyes, because for those who like their hearts and souls, there is no such thing as separation." #love#realtalk@quietworld
@QuietWorld · Post #6966 · 24.11.2019 г., 05:35
💯 #realtalk#truth @quietworld🍃
@QuietWorld · Post #6573 · 13.08.2019 г., 06:49
#realtalk#truth@quietworld🍃
@QuietWorld · Post #6460 · 15.05.2019 г., 04:50
#truth#realtalk @quietworld🍃
@QuietWorld · Post #6457 · 14.05.2019 г., 11:23
I appreciate honesty over everything. If you tell me what it is upfront and give me the option to take it or leave it, I respect that. #truth#realtalk@quietworld🍃
@QuietWorld · Post #6962 · 23.11.2019 г., 14:43
#love#reminder#realtalk @quietworld🍃
@QuietWorld · Post #7073 · 14.12.2019 г., 07:06
older than us, we were 22 when we were having this conversation), and two of my most observant friends talk about the self-conflict each of our coursemates had as they enter 21. & I wouldn't notice the 'pattern' if my friends didn't point out. & suddenly one of my friends started sharing his moment of depression and how he coped with it. & somehow at that moment I felt like my friends actually noticed my changed behaviour and suspected that there's something bothering my mind and they were actually trying to help me out by asking me out, being with me, spending time with me. & I'm glad that they are wise to not help me out by asking me what's wrong because if they ask me what's wrong , I don't even know what is wrong with me and me realizing that there's something off with me and not knowing what it is gonna make me feel so much wrong 😂 and I'm glad they didn't ask me that question. Instead, they just help me out by being there. I'm so grateful and blessed to have friends like them. I was grateful and I am more grateful now, because I just realized that there's actually so much more blessings I had that I haven't notice more in details until now. :') Anyway this is such a long post I didn't even have any idea that it was gonna be this long I wondered if anyone would even read it from beginning till the end, so here's a quick question, did I managed to keep you engaged from the beginning to the end of this post? 😅 #thoughts#afterthoughts#realtalk#poll @quietworld🍃
@QuietWorld · Post #6651 · 06.10.2019 г., 15:00
You do not miss the person; you miss the feelings you experienced with them. If you were to somehow receive similar feelings, you would dismiss & forget that person. #quotes#love#relationship#realtalk @quietworld🍃