@Markus · Post #161 · 23.07.2021 г., 10:05
I decided that I won't bother you with poetry in this channel except on my birthdays. But today I'm 36, so there you go: https://telegra.ph/36-07-22-2 #verse
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
Пребарај: #verse
@Markus · Post #161 · 23.07.2021 г., 10:05
I decided that I won't bother you with poetry in this channel except on my birthdays. But today I'm 36, so there you go: https://telegra.ph/36-07-22-2 #verse
Hashtags
@Markus · Post #141 · 23.07.2020 г., 09:45
I'm 35 today; so if you haven't got a present for me, read some of my poetry. https://telegra.ph/metamorphoses-1N-07-16#verse
Hashtags
@PensivePost · Post #4920 · 12.02.2021 г., 15:45
Things which really scare me Watching my own dreams digging my grave Waiting your words to tear me It sounds worse when you call my name You should hear me clearly I ain't here to playing again The deep cuts which you gave me Now those wounds giving no pain Your 'Forever' make no sense They can't be loyal? Make no friends Call it rude but its self defence I had a heart but it had no fence Darkish thoughts are getting intense Moon and stars ain't my reference Trauma take place in my veins Me and you got no difference Some situations never end Do care or don't pretend #verse#review
@PensivePost · Post #4875 · 05.02.2021 г., 15:28
I'm all alone Waiting for your response Staring at the moon Take me back to home Lying on my face Loving make no sense Waiting for the doom Take me back to home Feeling cold inside Making possible dive Head hit first on stone Take me back to home It's been too much to bear Take me away from hear Hell always been my room Take me back to home #review#verse
@PensivePost · Post #4878 · 06.02.2021 г., 14:27
Spectrum of love I had once affected from love We were one, now it's just get separate by move No one tried to prove Now we aren't into.., Love. But still checking up on each other's. Maybe we still don't want to get lose That was best life, when I had choose.., Her. Now it's getting worse and I can't do.., Anything. Stucked up on penny things, You and me had fucked up everything. Me and her, had dreams. It was fucked up ever since. #review#piyush#verse
@PensivePost · Post #4872 · 04.02.2021 г., 18:06
Why it's feels so alone? Maybe cause of I didn't hear my fav songs It's night and it's so dark It's feeling like I'm lost When this night will end? Stop living in my head! What if I stay calm? And what if you stay with me? There are thousands of words to say And you are not here to listen to me One day you would come at any reason for me And one day I'll be gone for many reasons and you won't see that coming.. #review#piyush#verse
@PensivePost · Post #4862 · 03.02.2021 г., 11:11
She just want to be alright, Even things are not all right, She's now crying like all night, She chooses darkness so she lose light. Now even god wants to know, who's right ? I didn't do anything wrong and idk if I have did maybe, No one knows how much I need you my baby, Again! You left me but when will this pain? You got yourself outta my life and I'm still in that lane. Sometime true love dies and no one gives a damn, Tell me after broking me what did you gain? #review#piyush#verse
@PensivePost · Post #4856 · 02.02.2021 г., 17:17
She cried and said “why you want to control me?” I cried and said “it doesn't make me lonely.” She said is love isn't there to make we us? I said that's right but what bout lust? She still think that I was hiding something And than she left me saying you share nothing Now she miss me too Losing controlling too She thought I was fake But now who left true? #verse#review#piyush
@PensivePost · Post #4855 · 02.02.2021 г., 17:05
She cried and said “why you want to control me?” I cried and said “it doesn't make me lonely.” She said is love isn't there to make we us? I said that's right but what bout lust? She still think that I was hiding something And than she left me saying you share nothing Now she miss me too Losing controlling too She thought I was fake But now who left true? #review#verse#piyush#pease
@TFGames · Post #2215 · 23.02.2024 г., 20:51
#DEV#CASINO#VERSE#WIND#CREEK #GAMES https://testflight.apple.com/join/KLkSwonU