How to write a shell in Python
Posted
by panzi
on Stack Overflow
See other posts from Stack Overflow
or by panzi
Published on 2010-04-07T17:31:13Z
Indexed on
2010/04/07
17:33 UTC
Read the original article
Hit count: 305
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?
© Stack Overflow or respective owner