How to structure packages

John Gordon gordon at panix.com
Wed Sep 7 18:11:11 CEST 2011


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

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon at panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"




More information about the Python-list mailing list