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
File details
Details for the file interactive_click-0.0.1.tar.gz
.
File metadata
- Download URL: interactive_click-0.0.1.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcd0a9fda79b128358ea45113147b4c6d5fe23ce6bb489aa53a6d31e332fdb0c |
|
MD5 | 20dccd2a223198583d345877c5865df5 |
|
BLAKE2b-256 | d1ea2b12fe083919da9d9e4d9b1a7ec1831783feb9e4d75a386c7be3715c935b |
File details
Details for the file interactive_click-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: interactive_click-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87928c021063037becda9984e09443f76dba5ab72051dd9d109d2badd89a8923 |
|
MD5 | 0be5c829669a3cf3a0546bf72b02ca60 |
|
BLAKE2b-256 | 3acd5a57ad52126d942fca745e502f6d5e84fd0f43f1141dfcd6853e68fdbd68 |