[Edu-sig] Re: Teaching graphics with Python (was Introductoryhighschool programming)

Arthur ajsiegel at optonline.net
Sun Aug 1 18:19:31 CEST 2004

> > import cvisual
> > import time
> > import atexit
> >
> > def __waitclose():
> >     while not cvisual.allclosed(): time.sleep(0.05)
> > atexit.register(__waitclose)
> >
> > scene = cvisual.display()
> >
> > class sphere (cvisual.sphere):
> >     def __init__( self,*args,**keywords):
> >         cvisual.sphere.__init__(self)
> >         self.color=(0,0,1)
> >         self.complete_init( self, self, <------- TWO SELVES?
> >              1, scene, None)
> >
> > s=sphere()



I get to this by mechanically following some of what is being done in the
primitives.py module of the new VPython distribution.

As I say, there is no API documented for the facility of subclassing brought
to VPython through the Boost implementation.

And I suspect not as much attention was given to developing this as an
intuitive API as there might have been, and wouldn't be surprised if there
is no intention of the VPython project to document it.  Or at least to give
documentation of it any priority.  I suspect that from the focused concerns
of the VPython project, the facility is  seen - at least at this point - as
a byproduct of the use of Boost, rather than something they want to
"confuse" their users with.

Doesn't mean I'm not free to confuse their users with it ;).


More information about the Edu-sig mailing list