TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #199 · 8 јан.

Многие из тех кто активно работал с Python2 несколько удивлены, почему в Python3 удобная функция reload() переехала из builtin в imp а потом и в importlib? Ну было же удобно! А теперь лишний импорт😖 Дело в том, что начиная с Python3.3 функция reload() переписана на Python вместо Cи. Что это нам даёт? 🔸 Такой код проще поддерживать и развивать 🔸 Python код легче читать, изучать и понимать. Сравните это ➡️ и это ➡️. 🔸 Как результат пункта 2, проще писать свои расширения импорта. Например, пользовательский импортёр с какой-либо хитрой логикой по аналогии с импортом из zip архивов. А есть ли у этого решения недостатки? Да, они всегда есть. 🔹 Так как это не builtin функция, её следует импортнуть перед использованием 🔹 Скорость замедлилась примерно на 5%. Очевидно, что это совершенно не критично. К тому же от версии к версии логика импорта будет оптимизироваться и ускоряться. В самом начале файла importlib/__init__.py мы видим такой импорт: import _imp # Just the builtin component, NOT the full Python module То есть часть функционала по прежнему написана на Си, но достаточно низкоуровневая. #basic

Hashtags

Резултати

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

Пребарај: #realproject

当前筛选 #realproject清除筛选
Dasturlash hayoti️️ ️

@dasturlash_hayoti · Post #4116 · 27.12.2025 г., 07:38

#JavaScript#API#RealProject#webdev#dasturlash_hayoti 👨‍💻 JavaScript + API: Real loyiha Xabarlarni ro‘yxat qilib chiqarish + avtomatik yangilanish Bu bosqichda: - har bir xabar alohida chiqadi - sahifa refreshsiz yangilanadi - real chatlarga yana yaqinlashamiz 1️⃣HTML — xabar yozish va chat oynasi <!-- Xabar yozish --> <input type="text" id="message" placeholder="Xabar yozing"> <button onclick="sendMessage()">Yuborish</button> <!-- Chat ro'yxati --> <ul id="chat"></ul> ul — xabarlar ro‘yxat bo‘lib chiqishi uchun 2️⃣ JavaScript — xabar yuborish va ro‘yxatga qo‘shish <script> function sendMessage() { // Inputni chaqiramiz let input = document.getElementById("message"); // Inputdagi qiymat let msg = input.value; // Bo‘sh xabar yuborilmasligi uchun if (msg === "") return; // Serverga xabar yuborish fetch("https://jsonplaceholder.typicode.com/posts", { method: "POST", body: JSON.stringify({ text: msg }), headers: { "Content-type": "application/json" } }) .then(res => res.json()) .then(data => { // Xabarni chat ro‘yxatiga qo‘shamiz addMessage(data.text); // Inputni tozalaymiz input.value = ""; }); } </script> 3️⃣JavaScript — xabarni ro‘yxatga qo‘shish <script> function addMessage(text) { // Chat ro‘yxatini chaqiramiz let chat = document.getElementById("chat"); // Yangi xabar uchun <li> yaratamiz let li = document.createElement("li"); // Xabar matnini joylaymiz li.innerText = text; // Xabarni chatga qo‘shamiz chat.appendChild(li); } </script> Endi: - har bir xabar pastga qo‘shilib boradi - eski xabarlar yo‘qolmaydi Telegram, kommentlar, chatlar — barchasi shu mantiqda ishlaydi. ☑️Natija ⏺️JavaScript → foydalanuvchi bilan ishlaydi ⏺️API → server bilan gaplashadi ⏺️Sayt → jonli bo‘ladi ➡️Keyingi post: Enter bosilganda yuborish + real-time’ga yana yaqinlashtiramiz 🔥 💻@dasturlash_hayoti— dasturchilar hayoti va IT memlari aralash kanal😉

Dasturlash hayoti️️ ️

@dasturlash_hayoti · Post #4115 · 26.12.2025 г., 08:59

#JavaScript#API#RealProject#webdev#dasturlash_hayoti ➡️Keyingi postda nima bo‘ladi? Keyingi darsda: ⏺️ xabarlarni bitta emas, ro‘yxat qilib chiqaramiz ⏺️ yangi xabar kelganda sahifa avtomatik yangilanadi Ya’ni: ❌ refresh yo‘q ☑️ real-time ishlash Post JavaScript + API asosida, to‘liq real loyiha ko‘rinishida bo‘ladi. 👉O‘tkazib yubormang! 💻@dasturlash_hayoti— dasturchilar hayoti va IT memlari aralash kanal😉

Dasturlash hayoti️️ ️

@dasturlash_hayoti · Post #4113 · 24.12.2025 г., 12:44

#JavaScript#API#RealProject#webdev#dasturlash_hayoti ⚠️⚠️⚠️ Diqqat, JavaScript o‘rganuvchilar! Keyingi post: ❌ faqat nazariya emas ☑️JavaScript + API orqali real loyiha bo‘ladi Ya’ni: ⏺️serverdan ma’lumot olish ⏺️sahifani yangilamasdan ishlash ⏺️hammasi real kod bilan💻 Shunaqa amaliy post kerakmi? 👍 Ha, JS + API bilan 🔥 Yo'q, shart emas Qiziqish bo‘lsa — bosqichma-bosqich tushuntirib chiqaramiz