Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Python Basics Exercises: Modules and Packages (Summary)

Congratulations! You’ve cemented your knowledge of how to build your own application by putting related code into separate files called modules, which you can organize into packages. You’ve also tested your ability to access names from other modules with the import statement.

In this video course, you’ve practiced:

  • Creating your own modules
  • Using modules in another file through the import statement
  • Organizing several modules into a package with __init__.py

You’ve reinforced what you learned in Python Basics: Modules and Packages, and you’ve also gained insight into how to tackle coding challenges in general, which can be a great way to level up as a developer.

For more on modules and packages, check out:

To continue on your learning journey, you can check out the other Python Basics courses or grab a copy of Python Basics: A Practical Introduction to Python 3.

Download

Sample Code (.zip)

4.4 KB
Download

Course Slides (.pdf)

4.2 MB

00:00 Congratulations, you’ve made it to the last lesson of this Python Basics Exercises video course. In this course, you practiced how to create your own modules, use modules in another file via the import statement, and organized several modules into a package.

00:16 You used code comments to help you get organized and broke exercises into smaller tasks. You used descriptive variable names, which is always a good idea also for the modules and the package.

00:29 And then you tested repeatedly to see what the code does and what you expected it to do.

00:35 If you want to deepen your knowledge about modules and packages even more, then I have some additional resources for you. The Python Modules and Packages: An Introduction video course and tutorial explores modules and packages even more than you did in this course or in the Python Basics: Modules and Packages course.

00:52 It’s a perfect refresher if you had to scratch your head too much in this video course. Another resource I can highly recommend is the Code Conversation that Ian and Geir Arne had on Everyday Project Packaging With pyproject.toml.

01:06 This video course will answer a few questions that you might have had in this video course, and you can join them discussing the best practices of building a modern Python package.

01:16 And last but not least, there is Python import: Advanced Techniques and Tips. In this in-depth tutorial, you’ll learn how to harness the power of Python’s import system to improve the structure and the maintainability of your code.

01:30 And of course, you can always revisit the Python Basics video course on modules and packages. After all, that’s what this video course is based on.

01:41 And that’s a wrap. Thanks again for joining me on this video course, and I hope to see you around next time at realpython.com.

Become a Member to join the conversation.