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

Резултати

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

Пребарај: #beginner

当前筛选 #beginner清除筛选
Repositorio data science

@repo_science · Post #3454 · 19.07.2023 г., 18:01

#powerBI#Beginner 📊 Microsoft Power BI - Complete Beginners Guide to Financial Dashboards Microsoft PowerBI is Microsoft’s new business intelligence tool. I will guide you from downloading and installing Microsoft Power BI Desktop to creating reports and dashboards with a sample data set. 🔗Link ----- Main channel:@repo_science Coupons:@freecoupons_reposcience -----

Repositorio data science

@repo_science · Post #3452 · 19.07.2023 г., 02:11

#powerBI#Beginner 📊 Microsoft 365 Power BI- Beginner This course begins the Power BI Desktop journey with an introduction to self-service business intelligence. The basics are addressed by connecting to data and preparing it for formal analysis. Considering what makes a good visual comes next followed by a number of visuals. Finally a dashboard is created in the Power BI Service with interactivity. 🔗Link ----- Main channel:@repo_science Coupons:@freecoupons_reposcience -----

Pensive|

@PensivePost · Post #4928 · 14.02.2021 г., 11:39

Once again ! Once again someone came and went Shattered my heart once again Yeah it was me Who built bunch of expectations But I just followed my heart once again I know she was worthy enough to fall for But that's not how goes life's cart, once again I wanted to confess this time too But yeah; in race of this hiding emotions I proved that I'm smart once again Brain said Stupid go and study But it wasn't heard by heart once again Did my best to stop it But uncontrollable was my Emotional dart, once again I tried decorating it by all mean But I guess this wasn't my chart once again I know it's a bit difficult to digest But yummy was this tart once again Well it's done now Let's have a new start once again Yess people come and go In someone we will find our part once again It's okay to end this now Beacuse; that's after end Where something new start once again Dear heart it's okay Just start behaving like heart once again So I guess I'm free now Feeling the freedom athwart once again And it's going to be Me only So I won't let anyone impart once again Dear heart please Now start behaving like heart once again What did u just say U r missing her Don't u dare to start mr. Heart once again Once again I fell for someone And yeah We simply fell apart once again ! #review#poetry#beginner#anniii

English Speakers

@English_Speakers · Post #5139 · 23.12.2022 г., 16:46

#converisation #Beginner #Daily_life @English_speakers ⚜➖⚜➖⚜➖⚜➖⚜➖ A: I’m going to take a nap. B: You should unplug the phone. A: That’s a good idea. B: Do you want me to wake you in an hour? A: No, thanks. Just let me sleep until I wake up. B: I’ll start dinner at 6:00. A: Okay. I think I’ll be awake by then. B: If not, your nose will wake you up. A: You mean I will smell the food cooking? B: You might even dream about dinner A: I don’t think I’m going to dream about anything. I’m really tired. B: Have a nice nap. Listen and practice 👇

Dasturlash hayoti️️ ️

@dasturlash_hayoti · Post #4101 · 15.12.2025 г., 13:15

#Dasturlash#IT#Beginner#futurecoder#OnlineLearning futurecoder — dasturlashni noldan o‘rganish uchun mukammal platforma futurecoder — bu hech qanday tayyorgarliksiz dasturlashni boshlash mumkin bo‘lgan bepul va interaktiv ta’lim sayti. Platforma foydalanuvchini asta-sekin fikrlashga, kod yozishga va muammolarni hal qilishga o‘rgatadi. Qanday o‘rgatadi? — Brauzer ichida kod yozish va ishga tushirish — Interaktiv topshiriqlar va real misollar — Har bir mavzu bo‘yicha aniq va sodda tushuntirishlar — Qiyinchilik darajasi bosqichma-bosqich oshirib boriladi Afzalliklari: — Dastur o‘rnatish shart emas — Amaliyotga yo‘naltirilgan — O‘rganish jarayonida xatolarni tushuntirib beradi — Mustaqil o‘rganish uchun juda qulay Kimlar uchun mos? — Dasturlashni endi boshlayotganlar — Python’ni tez va tushunarli o‘rganmoqchi bo‘lganlar — O‘qituvchilar va mentorlar — Amaliy mashqlar orqali bilim olishni istaganlar Rasmiy sayt: 👉https://futurecoder.io/ 💻@dasturlash_hayoti— dasturchilar hayoti va IT memlari aralash kanal😉

GitHub Trends

@githubtrending · Post #14891 · 01.07.2025 г., 11:30

#other#beginner#contribution#contributions_welcome#css#frontend#hacktoberfest#html#javascript#open_source#opensource#php#projects#python#react You can find a well-organized collection of coding project ideas divided into three skill levels: beginner, intermediate, and advanced. Each project includes clear goals, user stories, optional bonus features, and helpful resources, making it easier for you to build and extend your projects. This helps you improve coding skills, experiment with new technologies, and create impressive portfolio pieces to attract employers or clients. The list covers various technologies like JavaScript, Python, React, MERN stack, and blockchain, with tutorials and design resources included. You can also contribute ideas and examples to grow the collection and get community support. This resource saves you time and inspires your learning journey. https://github.com/The-Cool-Coders/Project-Ideas-And-Resources