On Aug 6, 9:38 am, Bill <[EMAIL PROTECTED]> wrote: > 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. > > Thanks in advance > (unless you are just a Python nut who is flaming to tell me that I > should not want this. :-) ) > > Bill
I'm not aware of any way to do this without modifying the original source in some fundamental way. You may be able to use some metaprogramming techniques, like decorators, to achieve this, although I'm not thinking of anything clever at the moment. ------------------- Mike Driscoll Blog: http://blog.pythonlibrary.org Python Extension Building Network: http://www.pythonlibrary.org -- http://mail.python.org/mailman/listinfo/python-list