Next / Previous / Contents / Shipman's homepage

6. Module imports

fohelpers.py
# - - - - -   I m p o r t s

We need the usual sys module for access to the standard streams.

fohelpers.py
import sys

The etbuilder.py module is used to construct the actual XML, and comes from comes from Python XML processing with lxml.

fohelpers.py
from etbuilder import et, E, subElement

Python's Decimal module handles dimensional arithmetic within the FoDim class. The second line calls this module's getcontext() function to limit the precision of decimal values to six significant digits.

fohelpers.py
from decimal import Decimal, getcontext
getcontext().prec = 6