ENع
الدرس 15 · Real programs

Modules and packages

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

Real programs are split across many files. A module is one .py file, and a package is a folder of modules. Step through a five-line main.py that imports greet.py and shapes/square.py. Watch Python search sys.path, run each module once, save it in sys.modules, and reuse it on the next import. Then see what __name__ == "__main__" is for, and what a misspelt import does.

14 دقيقة11 خطوات5 أسئلةBeginner
شكل 15 · تفاعلي
جارٍ تحميل الرسم…
أو ← →

اختبار يتاح بعد الخطوة الأخيرة.