What Does Python's __init__.py Do? Introducing __init__.py & Building a Basic Example

Опубликовано: 05 Март 2026
на канале: Real Python
740
32

Download your free Python Cheat Sheet here: https://realpython.com/cheatsheet
Free Python Skill Test with instant level + learning plan: https://realpython.com/skill-test
Want to learn faster? Become a Python Expert with unlimited access to 5,000+ tutorials, videos, and exercises: https://realpython.com/start


This is a preview of the video course, "What Does Python's __init__.py Do?". Python’s special __init__.py file marks a directory as a regular Python package and allows you to import its modules. This file runs automatically the first time you import its containing package. You can use it to initialize package-level variables, define functions or classes, and structure the package’s namespace clearly for users.

This is a portion of the complete course, which you can find here: https://realpython.com/courses/init-py/

The rest of the course covers:
Using the Basic Example in the REPL
Flattening the Interface - Code
Flattening the Interface - REPL
Managing Wildcard Imports
What Does Python's __init__.py Do? (Quiz)


🐍 Become a Python expert with real-world tutorials, on-demand courses, interactive quizzes, and 24/7 access to a community of experts at https://realpython.com

▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰
🐍 Start Here → https://realpython.com/start
🗺️ Guided Learning Paths → https://realpython.com/learning-paths
🎧 Real Python Podcast → https://realpython.com/podcast

📚 Python Books → https://realpython.com/books
📖 Python Reference → https://realpython.com/ref
🧑‍💻 Quizzes & Exercises → https://realpython.com/quizzes

🎓 Live Courses: https://realpython.com/live
⭐️ Reviews & Learner Stories: https://realpython.com/learner-stories
▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰▰


На этой странице сайта вы можете посмотреть видео онлайн What Does Python's __init__.py Do? Introducing __init__.py & Building a Basic Example длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Real Python 05 Март 2026, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 740 раз и оно понравилось 32 зрителям. Приятного просмотра!