18.2 class PiClass: def __str__(self): return "PI" pi = PiClass() 18.3 >>> mathproj.comp.numeric.n1 Traceback (most recent call last): 18.3.1 Basic use of mathproj >>> import mathproj Hello from mathproj init >>> mathproj.version 1.03 18.3.2 Loading subpackages >>> import mathproj >>> mathproj.comp.numeric.n1 Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'comp' >>> import mathproj.comp.numeric.n1 Hello from mathproj.comp init Hello from numeric init >>> mathproj.comp.numeric.n1.g() version is 1.03 Called function h in module n2 >>> mathproj.comp >>> mathproj.comp.numeric 18.3.3 import statements within packages from mathproj import version from mathproj.comp import c1 from mathproj.comp.numeric.n2 import h def g(): print "version is", version print h() from ... import version from .. c1 import x form . n2 import h 18.4 The __all__ attribute >>> from mathproj import * Hello from mathproj init Hello from mathproj.comp init >>> comp >>> c1 Traceback (most recent call last): File "", line 1, in NameError: name 'c1' is not defined >>> from mathproj.comp import c1 >>> c1