tags:

views:

166

answers:

2

I've written a small console application that can perform certain tasks. The user interface is similar to things like version control systems or yum etc. So basically you can think of it as a domain specific language. Now I'd like to write a (bash like) shell that can execute and auto-complete this language and has a command history (so I do not have to load and save the quite large xml files on each command). In a nutshell I want something like ipython but not for executing python code but my own DSL.

Are there any libraries that help me doing this? I see that there is a readline and rlcompleter module in python but its documentation seems to indicate that this is only for use with the python shell itself, or did I miss something there?

+6  A: 

You should check out the cmd and cmd2 modules. I think they will do what you want. There was a PyCon talk about these.

BrianLy
Yes that was exactly I was looking for! Thanks.
panzi
+1  A: 

If you need an administrative shell to be accessed via network Twisted python framework's manhole is a good solution. Example:

http://www.devshed.com/c/a/Python/SSH-with-Twisted/3/

zoli2k