Read the section on modules , the documentation of the import statement, imp module (in particular, examples) and, possibly, the documents for __import__ inline . It has a long way to go. If you still want to know more, I would suggest asking a specific question, this is a bit on the broad side.
Change After reading your question again, there is a certain part to your question about what __init__.py does in packages. It can be empty or contain the initialization code that will be executed when this package is imported. See the section on packages for more details.
In __init__.py you can also set __all__ , which determines which characters are imported when you do from yourpackage import * . This is explained in detail in importing * from a package .
source share