First page Back Continue Last page Overview Graphics

Importing Names Directly

Names from a module can directly be imported into the importing module’s symbol table:

>>> from fibo import fib, ifib

>>> ifib(500)

1 1 2 3 5 8 13 21 34 55 89 144 233 377

This does not introduce the module name from which the imports are taken in the local symbol table.

Import all names defined in a module:

>>> from fibo import *

>>> fib(500)

1 1 2 3 5 8 13 21 34 55 89 144 233 377

This imports all names except those beginning with an underscore (_).