Hello, > Is there anyway I can extend python to accept a command > which looks more like shell syntax than a function call. > > I want to be able to do this: > > if blah : > MyCommand Arg1 Arg2 > > as opposed to this: > > if blah : > MyCommand(Arg1,Arg2) > > or this: > > if blah : > x("MyCommand Arg1 Arg2") > > Of source, I would like to do this by writing a module (or through > some other run-time hook) as opposed to editing the Python source > code. You might want to have a look at ipython, they do something like that but for the command interpreter and not the compiler.
The other option will be to write a compiler from your syntax to valid Python syntax. However this my not be simple since you need to know the context. e.g. is f("a b c") calling f in the string "a b c" or f(a, b, c)? HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list