On Tue, 06 Nov 2007 19:09:21 +0200, Donn Ingle <[EMAIL PROTECTED]> wrote: >Hi, >I'm doing something odd with pycairo and friends and I want to see what >commands are coming out of my objects. > >Here's some code: > >class Box: > def draw() > self.context.set_source_rgb(1, 0, 0) > self.context.rectangle(0, 00, 50, 50) > self.context.fill() > >Box.draw() draws a red box, all fine. But, I *also* want it to output the >actual commands within the draw def to the console (or a file).
See inspect.getsource(). Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list