create new statement?

Steve Purcell stephen_purcell at
Fri Mar 2 20:13:00 CET 2001

Bruce Edge wrote:
> I want to add my own command to the interp, but not have to use object
> calling syntax
> eg:
>     create obj opt
> not
>     create(obj, opt)
> How do I define new statements, or, a way of calling functions using the
> former syntax?

You can get the effect you want by subclassing 'Cmd' in the 'cmd'
standard library module and using your subclass in place of the usual
interactive command interpreter.


Steve Purcell, Pythangelist
Get testing at
Get servlets at
"Even snakes are afraid of snakes." -- Steven Wright

More information about the Python-list mailing list