How to make a command line interface or interpreter in Python Derive from cmd.Cmd, overriding the various methods as necessary.