24

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?

2 Answers 2

23

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

Sign up to request clarification or add additional context in comments.

1 Comment

The link to the talk is not working anymore. An alternative link to the same talk is here on pyvideo. . The talk is called: Easy command-line applications with cmd and cmd2 (#153) from pycon us 2010.
3

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/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.