From the course: Python Theory for Network Engineers
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Python modules - Python Tutorial
From the course: Python Theory for Network Engineers
Python modules
- [Instructor] You've heard me talk about Python modules a few times in this course already. Let's talk more about it in this section. First of all, what is a Python module? In Python, a module is simply any file that contains Python code. That's why when we have written code that contains Python class and function before, I refer to them as Python modules, which is totally valid. But more broadly, we could also refer to Python modules as being a folder that contains a group of files that serve the same purpose. So why do we want to do that? Of course, the first advantage is the maintainability. If we group them into certain folder, it becomes easier to organize and to work on them separately, especially if there's multiple people working on the same function. Also, it makes it more simple. It goes hand in hand with maintainability. You're making it simple to look at that file and know what the general purpose of that file…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.