Skip to main content

Creating a Python Module

Hands-On Lab

 

Photo of Keith Thompson

Keith Thompson

DevOps Training Architect II in Content

Length

00:45:00

Difficulty

Beginner

Being able to reuse code is incredibly useful, but to make our code even more useful, we need to bundle it up so that it can be used from other programs. The primary way this is done in Python is by using modules. In this hands-on lab, we'll define and use our custom module and built-in modules to ensure the using_modules.py file can execute properly. The following are prerequisites for feeling comfortable completing this lab: - Creating and importing modules. Watch the "Creating and Using Python Module" video from the [Certified Associate in Python Programming Certification][1] course. - Using different import styles. Watch the "Using Imports" video from the [Certified Associate in Python Programming Certification][1] course. [1]: https://linuxacademy.com/cp/modules/view/id/470

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.