Modules and Module Files

This chapter provides introductions and tutorial examples about on modules and module files. Topics include introduction of 'module' objects and module files; importing module files to create modules; reloading modules; accessing module members; importing module members only.

What Is Module

"import module" - Two-Step Process

sys.modules - Listing Loaded Modules

importlib.reload(module) - Reloading Module

What Are Module Members

"from module import member" Statement

"from module import *" Statement

What Is __all__ List

__pycache__/module.version.pyc Files

What Is the __main__ Module


Table of Contents

 About This Book

 Running Python Code Online

 Python on macOS Computers

 Python on Linux Computers

 Built-in Data Types

 Variables, Operations and Expressions

 Statements - Execution Units

 Function Statement and Function Call

 Iterators, Generators and List Comprehensions

 Classes and Instances

Modules and Module Files

 Packages and Package Directories

 "sys" and "os" Modules

 "pathlib" - Object-Oriented Filesystem Paths

 "pip" - Package Installer for Python - Python Libraries for Science

 pandas - Data Analysis and Manipulation

 Anaconda - Python Environment Manager

 Jupyter Notebook and JupyterLab


 Full Version in PDF/EPUB