@command(short_help='View a given module in your editor.', name='open')
@option('--three/--two', is_flag=True, default=None, help='Use Python 3/2 when creating virtualenv.')
@option('--python', default=False, nargs=1, callback=validate_python_path, help='Specify which version of Python virtualenv should use.')
@argument('module', nargs=1)
def run_open(module, three=None, python=None):
    from .core import which, ensure_project
    ensure_project(three=three, python=python, validate=False)
    c = delegator.run('{0} -c "import {1}; print({1}.__file__);"'.format(which('python'), module))
    try:
        assert (c.return_code == 0)
    except AssertionError:
        echo(crayons.red('Module not found!'))
        sys.exit(1)
    if ('__init__.py' in c.out):
        p = os.path.dirname(c.out.strip().rstrip('cdo'))
    else:
        p = c.out.strip().rstrip('cdo')
    echo(crayons.normal('Opening {0!r} in your EDITOR.'.format(p), bold=True))
    edit(filename=p)
    sys.exit(0)
@command(short_help='View a given module in your editor.', name='open')
@option('--three/--two', is_flag=True, default=None, help='Use Python 3/2 when creating virtualenv.')
@option('--python', default=False, nargs=1, callback=validate_python_path, help='Specify which version of Python virtualenv should use.')
@argument('module', nargs=1)
def run_open(module, three=None, python=None):
    from .core import which, ensure_project
    ensure_project(three=three, python=python, validate=False)
    c = delegator.run('{0} -c "import {1}; print({1}.__file__);"'.format(which('python'), module))
    try:
        assert (c.return_code == 0)
    except AssertionError:
        echo(crayons.red('Module not found!'))
        sys.exit(1)
    if ('__init__.py' in c.out):
        p = os.path.dirname(c.out.strip().rstrip('cdo'))
    else:
        p = c.out.strip().rstrip('cdo')
    echo(crayons.normal('Opening {0!r} in your EDITOR.'.format(p), bold=True))
    edit(filename=p)
    sys.exit(0)