Prompt Types in ItsPrompt
The following prompt types are available in ItsPrompt:
select
ans = Prompt.select(
question='What food would you like?',
options=(Separator('The veggies'), 'Salad', Separator('The meaties'), 'Pizza', 'Burger'),
default='Pizza',
)
To read more about the parameters of the select prompt, see the definition of select().
raw_select
ans = Prompt.raw_select(
question='What pizza would you like?',
options=('Salami', 'Hawaii', 'four-cheese'),
allow_keyboard=True,
)
To read more about the parameters of the raw_select prompt, see the definition of raw_select().
expand
ans = Prompt.expand(
question='Where do you want your food to be delivered?',
options=('my home', 'another home'),
allow_keyboard=True,
)
To read more about the parameters of the expand prompt, see the definition of expand().
checkbox
ans = Prompt.checkbox(
question='What beverages would you like?',
options=('Coke', 'Water', 'Juice'),
default_checked=('Water',),
disabled=("Coke",),
min_selections=1,
)
To read more about the parameters of the checkbox prompt, see the definition of checkbox().
confirm
ans = Prompt.confirm(
question='Is the information correct?',
default=True,
)
To read more about the parameters of the confirm prompt, see the definition of confirm().
input
ans = Prompt.input(
question='Please type your name',
validate=input_not_empty,
)
To read more about the parameters of the input prompt, see the definition of input().
table
data = DataFrame({
'Food': ['Pizza', 'Burger', 'Salad'],
'Qty': [1, 0, 0],
})
ans = Prompt.table(
question='Please fill in your quantity',
data=data,
)
To read more about the parameters of the table prompt, see the definition of table().