def pick_in_list(list_name, obj_list):
    print('\n%ss available' % list_name)
    for num, i in enumerate(obj_list):
        print('\t%d) %s' % (num+1, i.name))
    try:
        selected_num = raw_input('\nPlease select a %s number [1]: ' %
                                 list_name.lower())
        selected_num = int(selected_num) - 1
        selected = obj_list[selected_num]
    except (ValueError, IndexError):
        selected = obj_list[0]
    print('Using %s %s.' % (list_name.lower(), selected.name))
    return selected

# Check if the user has application credentials
Generic function to ask the user to choose from a list.
dataset/ETHPy150Open runabove/python-runabove/examples/walkthrough/walkthrough.py/pick_in_list