Skip to main content

No project description provided

Project description

interactive-click

Installation

pip install interactive-click

Usage

import click

@click.command()
@click.option('--name', prompt='Your name', help='The person to greet.')
def cli(name):
    click.echo('Hello %s!' % name)

if __name__ == '__main__':
    import sys
    
    # Can be simply run by:
    #     run_interactive(cli)
    # But we can also wrap it by checking whether the user is running the script without any arguments
    if len(sys.argv) == 1:
        # No arguments, run interactive mode
        try:
            from interactive_click import run_interactive

            run_interactive(cli)
        except ImportError:
            cli()

    else:
        cli()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

interactive_click-0.0.2.tar.gz (7.4 kB view hashes)

Uploaded Source

Built Distribution

interactive_click-0.0.2-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page