How to Import a Module Into Python
Find the module., Use: from import This will tell the script you are using specific functions from a specific module. , Use multiple functions., Use multiple modules., Import entire modules.
Step-by-Step Guide
-
Step 1: Find the module.
Locate the module that you will be importing.
A complete list of built in modules can be found here (v2.7) and here (v3.5). -
Step 2: Use: from import This will tell the script you are using specific functions from a specific module.
, You can use commas (,) to seperate functions if you are using multiple functions from one module. , To import multiple modules, you must make multiple import lines. , To import an entire module, use from import * -
Step 3: Use multiple functions.
-
Step 4: Use multiple modules.
-
Step 5: Import entire modules.
Detailed Guide
Locate the module that you will be importing.
A complete list of built in modules can be found here (v2.7) and here (v3.5).
, You can use commas (,) to seperate functions if you are using multiple functions from one module. , To import multiple modules, you must make multiple import lines. , To import an entire module, use from import *
About the Author
Kelly Peterson
Kelly Peterson is an experienced writer with over 11 years of expertise in lifestyle and practical guides. Passionate about sharing practical knowledge, Kelly creates easy-to-follow guides that help readers achieve their goals.
Rate This Guide
How helpful was this guide? Click to rate: