2015/8/26
一直以来对__init__.py
在Python中的作用比较模糊,一致认为它大概的作用是: 让一个目录(directory)编程一个包(package),google之后的答案是:
The __init__.py files are required to make Python treat the directories as
containing packages; this is done to prevent directories with a common name,
such as string, from unintentionally hiding valid modules that occur later on
the module search path. In the simplest case, __init__.py can just be an empty
file, but it can also execute initialization code for the package or set the
__all__ variable, described later.
==>http://stackoverflow.com/questions/448271/what-is-init-py-for
==>https://docs.python.org/2/tutorial/modules.html#packages
大家一般是是如何使用的(在该文件中写些什么)?
把他当做class中的
__init__()
就好啦