Python Essentials

XML Programming

I am using lxml for parsing and writing XML files these days. It has a very simple syntax, works with XML in a very Pythonesque… idiom, and is fast.

Local Includes

To include a local module, the following criteria must be satisfied:

  • a file called __init__.py exists in each directory with libraries to import.

  • You can build a library heirarchy like this:

    project_base/
    +-- __init__.py
    +-- lib1/
        +-- __init__.py
        +-- utils.py
        +-- xml.py
        +-- render.py