def dmenu_format(choices, fmt=None):
    """Format iterable @choices into '\n' delimited dmenu input
    Arguments:
        fmt - Format string for each key:choice pair
    """
    if fmt is None:
        fmt = '{}: {}'
    dmenu_line = ''
    for c in choices:
        dmenu_line += (fmt+'\n').format(c[0], c[1])
    return dmenu_line