'Runs a Python interactive interpreter.'

@args('--shell', metavar='<bpython|ipython|python    >', help='Python    shell')
def run(self, shell=None):

    if (not shell):
        shell = 'bpython'
    if (shell == 'bpython'):
        try:
            import bpython
            bpython.embed()
        except ImportError:
            shell = 'ipython'
    if (shell == 'ipython'):
        try:
            from IPython import embed
            embed()
        except ImportError:
            try:
                import IPython
                shell = IPython.Shell.IPShell(argv=[])
                shell.mainloop()
            except ImportError:
                shell = 'python'
    if (shell == 'python'):
        import code
        try:
            import readline
        except ImportError:
            pass
        else:
            readline.parse_and_bind('tab:complete')
        code.interact()
