title: Python application with both interactive and inline mode
body: <p>I am trying to create a Python command-line app, which supports both interactive (currently using Cmd) and inline modes (like Python's <code>python -c</code>). Is there a good way to do it without duplicating the 'line parsing' code?</p>