At the beginning of most Python scripts, functionality that resides in other files is imported with the import statement. Built-in modules are usually imported like:
import os, sys
then functionality from those modules can be called by prefixing the
method name with the module name as in sys.stdout.write()
or
os.exit(0)
.
OEChem resides in the openeye module and is routinely imported as:
from openeye.oechem import *
where all methods and objects in the oechem namespace are pulled
directly into the current script's namespace. Since OEChem's methods
and objects all have unique names, there is little chance to have a
name clash with this particular import *
call.
Once the package is imported, objects can be created and methods can be called without the addition of namespace prefixes, resulting in simpler code.