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

Резултати

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

Пребарај: #surkhandarya

当前筛选 #surkhandarya清除筛选
EKOLOG.UZ| ENG

@ekologuzenglish · Post #12220 · 03.04.2026 г., 04:03

#Surkhandarya🦂 Humane Science: Student from Termez Develops a Way to Extract Scorpion Venom Without Killing It A third-year biology student at the Termez State Pedagogical Institute, Feruza Tukhtamurodova, has developed an innovative device that allows scorpion venom to be extracted without harming the animal. 🔬 Unlike traditional methods that often result in the death of the scorpion, this new approach uses safe electrostimulation. It enables repeated venom extraction from the same scorpion, without causing harm. 💡 Why it matters: — reduces the killing of animals — helps address the shortage of valuable biological material — opens new opportunities for medicine and pharmaceuticals 🧪 Scorpion venom is not just dangerous — it has significant medical potential. It contains chlorotoxin, which can slow the growth of cancer cells, as well as neurotoxins used in treating neurological disorders. 💰 Interesting fact: On the global market, scorpion venom can cost up to $12,000, while in Uzbekistan it is around $5,000. 🌱 This innovation shows that science can be both effective and humane. 👏 Proud of Uzbekistan’s young scientists! ☘️Read the latest environmental news on the @ekologuz page. Follow us and send your suggestions and wishes via @eklguz_bot Instagram | Facebook | Twitter | Sayt | Youtube.

EKOLOG.UZ| ENG

@ekologuzenglish · Post #12412 · 16.04.2026 г., 10:01

#Surkhandarya#Official_Response Earlier, our channel reported a case of cruel treatment by two individuals towards a desert tortoise listed in the Red Data Book of Uzbekistan. Following this incident, the Surkhandarya Regional Department of Ecology and Climate Change, together with officers of the internal affairs bodies and the National Guard, conducted оперативe investigation measures. The investigation revealed that the incident took place in April of this year. The individuals involved were identified as residents of the “Yangikuch” mahalla in Denov district — citizens N.J. and A.S. During the inquiry, citizen N.J. admitted guilt, stating that the act was committed unknowingly. (However, this raises a question: how can a mentally sound adult harm a living creature “unknowingly”?) Based on the case, the Denov District Department of Internal Affairs imposed an administrative penalty on N.J. under Article 111 of the Code of Administrative Responsibility of the Republic of Uzbekistan. A fine of three base calculation units was issued, amounting to 1,236,000 soums. The State Committee for Ecology and Climate Change of Uzbekistan reminds that cruelty to animals is strictly prohibited and entails liability in accordance with the law. Press Service of the Surkhandarya Regional Department of Ecology ☘️ Follow the latest environmental news on @ekologuz 📩 Send your suggestions and feedback via @eklguz_botInstagram | Facebook | Twitter | Sayt | Youtube.

Termiz tumani hokimligi

@termiztumanhokimligi · Post #37845 · 02.04.2026 г., 11:29

⚡️ Umummilliy AI Hackathon | Termiz — 1-kun. Termiz shahrida Umummilliy AI Hackathon birinchi kun rasmiy ochilish marosimi va kirish sessiyasi bilan boshlandi. Tantanali ochilish marosimida O‘zbekiston Respublikasi Prezidenti Administratsiyasining Moliyaviy texnologiyalar, raqamlashtirish va sun’iy intellekt bo‘yicha departamenti rahbari Bobur Xodjayev hamda Raqamli texnologiyalar vazirining birinchi o‘rinbosari Oleg Pekos so’zga chiqib yosh jamoalarga muvaffaqiyat tiladilar. Mehmonlar AI-ekotizimini rivojlantirish va yosh jamoalarni qo‘llab-quvvatlash muhimligini ta’kidladilar. Ishtirokchilarga xakaton mexanikasi hamda oldinda kutilayotgan ish jarayoni formati tanishtirildi. Kun davomida trening dastur doirasida soha ekspertlari tomonidan ma’ruzalar o‘tkazildi, jumladan: • Ziyomuhammad Usmonov — Global Move direktori • Azamat Majidov — OctoBank Product Manager’i • Usmon Rahimjonov —IT Park Uzbekistan vakili. Spikerlar startaplarning biznes jihatlari, mahsulot yaratishda sun’iy intellektning o‘rni hamda samarali pitch tayyorlash haqida so‘z yuritdilar. #AIHackathon#AIAlliance#Termiz#Surkhandarya#DigitalUzbekistan Surxondaryo.uz | Telegram | Facebook | Instagram | YouTube | X

Teach For Uzbekistan | Official

@teachforuzbekistan · Post #299 · 20.10.2025 г., 15:53

😎Teach For Uzbekistan dasturi doirasida bu safar Surxondaryodagi fellowlar uchun psixologik trening o‘tkazildi. 💬 Trening davomida ishtirokchilar pedagogik-psixologik bilimlarini mustahkamlab, o‘quvchini yaxshiroq tushunish uchun nimalar qilish kerakligi, o‘quvchi bizni tushunishi uchun qanday bo‘lishimiz kerakligi haqida fikr almashishdi. 🤝 Bu suhbatlar fellowlarga dars jarayonida o‘zaro ishonch, empatiya va samimiyatni kuchaytirish imkonini berdi. #TeachForUzbekistan#FellowTraining#PsixologikTrening#Surxondaryo#EducationForAll 💬💬💬 😎As part of the Teach For Uzbekistan program, a psychological training session was held for fellows in Surkhandarya. 💬 During the training, participants strengthened their pedagogical and psychological knowledge, discussing what needs to be done to better understand students and how to ensure that students understand us in return. 🤝 These conversations helped fellows build greater trust, empathy, and sincerity in their classroom interactions. #TeachForUzbekistan#FellowTraining#PsychologicalTraining#Surkhandarya#EducationForAll 📱Instagram🕊Telegram🔹Linkedin📱Facebook📺YouTube🌍Veb sayt