2011-09-28 37 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

...爲什麼?這是個人喜好嗎? –