Re: Insane crazy question - printing commands

2007-11-06 Thread Donn Ingle
Thanks for the replies -- Python, is there anything it can't do? :D \d -- http://mail.python.org/mailman/listinfo/python-list

Re: Insane crazy question - printing commands

2007-11-06 Thread Marc 'BlackJack' Rintsch
On Tue, 06 Nov 2007 19:42:08 +0200, Donn wrote: > Tried that, but get this error. I did a dir(inspect) in the command env. and > getsource it definitely there... > > Traceback (most recent call last): > File "inspect.py", line 1, in ? > import inspect > > File > "/home/donn/Projects/py

Re: Insane crazy question - printing commands

2007-11-06 Thread Guilherme Polo
2007/11/6, Donn <[EMAIL PROTECTED]>: > > import inspect > > > > class Box: > > def draw(self): > > print "hi" > > return 3 > > > > x = Box() > > print inspect.getsource(x.draw) > > Tried that, but get this error. I did a dir(inspect) in the command env. and > getsource it definitely there... > > Tr

Re: Insane crazy question - printing commands

2007-11-06 Thread Jean-Paul Calderone
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.rec

Re: Insane crazy question - printing commands

2007-11-06 Thread Donn
> import inspect > > class Box: >     def draw(self): >         print "hi" >         return 3 > > x = Box() > print inspect.getsource(x.draw) Tried that, but get this error. I did a dir(inspect) in the command env. and getsource it definitely there... Traceback (most recent call last): File "i

Re: Insane crazy question - printing commands

2007-11-06 Thread Guilherme Polo
2007/11/6, Donn Ingle <[EMAIL PROTECTED]>: > 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) >