How to structure packages

Rafael Durán Castañeda rafadurancastaneda at gmail.com
Wed Sep 7 19:18:43 CEST 2011


Check python pep8: http://www.python.org/dev/peps/pep-0008/

And you will see than you shouldn't named modules as you did, so you 
should do something like:

mypackage
     __init__.py
     mymodule
     ...

mypackage.mymodule.MyClass

On 07/09/11 18:11, John Gordon wrote:
> In<2a4f542c-a8c1-46c7-9899-a3fad0940cf6 at x11g2000yqc.googlegroups.com>  bclark76<bclark76 at gmail.com>  writes:
>
>> mypackage
>>      __init__.py
>>      myfunc.py
>>      MyClass.py
>> from mypackage import MyClass
> Try this instead:
>
>    from mypackage.MyClass import MyClass
>




More information about the Python-list mailing list