4/26/2014 - 6:01 AM

python import from package

anypackage/     # class WWW is originally defined in this xxx file.

generally speaking, python can only import class from modules, which is usually a .py file.

import WWW from xxx

But, we can also import class from a package(folder) directly, rather than from the module. This is where an file can step onto the stage.

anypackage/  # class WWW is then moved here.   

After we move the class from ordinary python file to special python file, we can import it from "anypackage" directly:

import WWW from anypackage

Why do we need to import from package, if we can import from module? 
When we import from a package, it can probably be viewed as a shortcut, as soft link in linux system