Crosscompute-select


Pay Notebook Creator: Salah Ahmed0
Set Session Lifetime: 10 minutes0
Total0

Using the Select Plugin

This notebook-tool demonstrates using the select plugin in your code

The select plugin takes a "list" (literally strings seperated by new lines, not python lists) of strings and gives the user the option to choose from among them, able to make multiple selections

To choose a default selection for the user, surround the string with '*'

{x_select: mode ? mode of transportation}

In [1]:
# show_standard_output = 'true'
x_select = """
    bike
    *walk*
    *run*
    *jazz hands*
    """
In [2]:
# print('mode = %s' % ', '.join(x_select.splitlines()))
print('{dash}\nselect_argument = {select}\n{dash}'.format(select=x_select, dash='-'*10))
print('I love to %s' % (', and '.join(x_select.split('\n'))))
----------
select_argument = 
    bike
    *walk*
    *run*
    *jazz hands*
    
----------
I love to , and     bike, and     *walk*, and     *run*, and     *jazz hands*, and