Python has two ways of importing modules. Both are useful, and you should know when to use each
import module
import sys
from module import syntax
from UserDict import UserDict
. important difference: the attributes and methods of the imported module types are imported directly into the local namespace, so they are available directly, without qualification by module name
from module import * to import everything
from types import FunctionType
FunctionType# Result: <type 'function'>
improt types
FunctionType # Result:
Error messagetypes.FunctionType# Result: <type 'function'>