feluxe / prmt Goto Github PK
View Code? Open in Web Editor NEWSimple and robust command line prompts
License: Apache License 2.0
Simple and robust command line prompts
License: Apache License 2.0
Split:prmt.select
into prmt.select_from_list
and prmt.select_from_dict
I'd need an option to have multiline input.
Something similar to https://python-prompt-toolkit.readthedocs.io/en/stable/pages/asking_for_input.html#multiline-input
Is that possible or planned?
Use the docstrings to apply a simple sphinx API documentation.
E.g.:
Please enter your password:
> *********
Currently the user can only choose one item from select()
. We could use an amount
parameter to allow the user to select one or multiple items. Multiple items could be selected via comma separation.
We currently have this:
a = prmt.select(
question='Select one:',
options=['foo','bar'],
fmt = ['\n{}\n', ' {}: {}', '\n', '[{}] ', '> {}\n']
)
We could use specific parameters as an alternative to fmt=
, e.g.:
a = prmt.select(
question='Select one:',
options=['foo','bar'],
fmt = ['\n{}\n', ' {}: {}', '\n', '[{}] ', '> {}\n']
fmt_question = '\n{}\n',
fmt_option = '{}: {}',
...
)
This way fmt
could be uses as a shortcut to define all rules as once, where fmt_*
would be useful to format specific items.
We could also add the fmt rules to the main arguments (for optional use):
a = prmt.select(
question=('Select one:', '\n{}\n'),
options=(['foo','bar'], ' {}: {}', '\n'),
default=(0, '[{}] ')
prompt='> {}\n'
)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.