Skip to content

Modules¶

About This Lesson¶

Learn to organize Python code into modules and packages. Master importing, creating your own modules, and working with Python's module system.

What You'll Learn¶

  • What are modules?
  • Importing modules (import, from...import)
  • Creating your own modules
  • The name variable and if name == "main"
  • Module search path
  • Packages and init.py
  • Standard library modules
  • Use the MkDocs navigation on the left to move between lessons
  • The notebook below is fully interactive - you can run and edit code
  • Your changes are saved in your browser's local storage

Interactive Notebook¶


Having trouble with the embedded notebook? Try one of these: