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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for interactive_click-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85381dca5977cd1be1368c6a0415abda7bb4ea0c599247561be0b2241606a8ea |
|
MD5 | 57813cb2fcb3d6d9edeaa2965938c28c |
|
BLAKE2b-256 | 2bee7419d1d5848422ac7e63833ac3f9294164561843801f5649d9abe0b65d74 |