1# This example shows simple usage of the wrapped Shape classes. 2# The main purpose of this example is to show the doxygen comments translation to PyDoc comments. 3# Users should look at the generated example.py file. 4# The generated PyDoc can be viewed in a browser by opening the example.html file. 5 6import example 7 8print "Creating some objects:" 9c = example.MakeCircle(10) 10print " Created circle", c 11s = example.MakeSquare(10) 12print " Created square", s 13r = example.MakeRectangleInt(10, 20) 14print " Created rectangle", r 15 16print "\nHere are some properties of the shapes:" 17for o in [c, s, r]: 18 print " ", o 19 print " area = ", o.area() 20 print " perimeter = ", o.perimeter() 21 22print "\nRunning pydoc, this is the equivalent to executing: pydoc -w ./example.py" 23 24import pydoc 25 26pydoc.writedoc("example") 27 28print "Open example.html in your browser to view the generated python docs" 29