2011-09-28 36 views
1

我正在完成我一直在编写的Python软件包的过程。但是,在我发布它之前,我希望获得关于该包的整体结构以及__init__.py文件的一些反馈。评论我的Python软件包结构

这应该了解我的__init__.py文件的外观。

''' 
A docsting describing the package. 
''' 

__author__  = myname 
__copyright__ = mycopyright 
__credits__ = listofcredits 
__license__ = mylicense 
__version__ = 0.0 
__maintainer__ = me 
__email__  = myemail 
__status__  = indevelopment 

# This contains a module with directories as strings (for file reference) 
import mypath 

# some modules 
import this 
import that 

# some gui widget classes 
from windowmodule import windowwidget 
from widgetmodule import someguiwidget 
from someothermodule import someotherguiwidget, andanotherguiwidget 

def __demo__() : 
    # a demo of the package 

if __name__ == '__main__' : 
    __demo__() 

这应该给出整体封装结构的体面的想法。

​​
+3

这可能更适合[codereview](http://codereview.stackexchange.com/)。 – SingleNegationElimination

回答

1

您应该使用绝对导入,而不是相对导入。 import mypackage.mypath as mypath

+0

...为什么?这是个人喜好吗? –