SLIDE 23 Using Python Modules
◮ The components of a Python module, or a (.py) file can be imported into
the current working space, using the ’import’ statement. Examples (discussed further in class)
- 1. import [module name]
- 2. import module1, module2
- 3. import module1 as alias
- 4. from [module name] import
[variable, function, class, submodule] <as alias>
◮ Once a module is imported, its contents can be accessed using the [.]
◮ The following statement imports everything(ish) from a module:
from [module name] import *
◮ Popular packages for scientific computing: math, numpy, scipy, matplotlib,
statsmodel, re, etc.
◮ Check this:
https://pythontips.com/2013/07/30/ 20-python-libraries-you-cant-live-without/
◮ Task: Open the script lesson6 modules.py
Hands-On Tutorial Python Modules and Packages [23/32] May 16, 2017: An Introduction to Scientific Python, Ahmed Attia. (http://samsi.info)