Next / Previous / Contents / TCC Help System / NM Tech homepage

4.2. Module imports

We use the Python 3.x style print() function; imports from the __future__ module must be done before any other executable statement.

pyrang
# - - - - -   I m p o r t s

from __future__ import print_function

First we'll need to import the standard Python sys module, which will give us access to the command line arguments and the standard I/O streams.

pyrang
import sys

Command line argument processing is done with the standard Python argparse module; see its Python library documentation.

pyrang
import argparse

To read the RNG schema file, we need the lxml.etree module, which we call et locally.

pyrang
import lxml.etree as et