Xml Processing

Introduction

An XML document is made up of structured tags to form a hierarchy of elements.

Packages

init.py

Files named init.py are used to mark directories on disk as a Python package directories. If you have the files

mydir/spam/__init__.py
mydir/spam/module.py

and mydir is on your path, you can import the code in module.py as:

import spam.module

or

from spam import module

If you remove the init.py file, Python will no longer look for submodules inside that directory, so attempts to import the module will fail.

The init.py file is usually empty, but can be used to export selected portions of the package under more convenient names, hold convenience functions, etc.

Reference: What is __init__.py used for?

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.