create new statement?

Bruce Edge bedge at troikanetworks.com
Fri Mar 2 20:32:55 CET 2001


Ken Seehof wrote:
> 
> Sorry, not without rebuilding python.
> 
> What is the actual problem that you are trying to solve?  Maybe there's
> another approach.

I'm creating a command line interface to a product.
I want to have access to python as a scripting tool, and be able to
access my own commands.
Ideally, this could be used by the end user. So, I'd like to not require
the my_func(args) syntax,
as that may look a bit kludgey/unfinished from a users standpoint. I'd
like to be able to use "my_command args" from the python cmd line.
Everything else I need is already there, readline line editing,
customizable tab-completer, python language support. 

My expertise is in Tcl, where this is trivial. I'm trying out python as
there are others here that already use it, and it's well, somewhat
syntactically cleaner.


-Bruce.


> 
> ----- Original Message -----
> From: "Bruce Edge" <bedge at troikanetworks.com>
> Newsgroups: comp.lang.python
> To: <python-list at python.org>
> Sent: Friday, March 02, 2001 10:34 AM
> Subject: create new statement?
> 
> > Can you add a new statement to python?
> > AFAICT the only type of commands that don't require () or . after them
> > are statements.
> >
> > 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?
> >
> > Thanks, Bruce.
> > --
> > http://mail.python.org/mailman/listinfo/python-list
> >



More information about the Python-list mailing list