From the course: Cisco DevNet Associate (200-901) Cert Prep 1: Software Development and Design

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

How to package your code for sharing

How to package your code for sharing

From the course: Cisco DevNet Associate (200-901) Cert Prep 1: Software Development and Design

Start my 1-month free trial

How to package your code for sharing

- [Instructor] Let's talk about Python packages. So far, we have talked about how to create reusable code by combining a group of code into functions, and grouping multiple functions and attributes into classes. These functions and classes are all written in normal Python files and become Python modules that can be imported into other files. So here's a problem, as we have more modules, what happens when we have multiple modules that have the same name? For example, there is a Python standard library called math. What if we want to create our own module also named math? By the way it is considered a bad practice to name your module the same name as the standard library, but let's just say we have a good reason for it. How would we differentiate the two? For that, we have to discuss namespace. A namespace, is basically a system to make sure that all the names in the program are unique so they could be used without…

Contents