def get_input(prompt="", default=None, input=raw_input):
    if default is not None:
        ri = input("%s [%s]> " % (prompt, default))
        if not ri:
            return default
        else:
            return ri
    else:
        return input("%s> " % (prompt, ))
Get user input with an optional default value.
dataset/ETHPy150Open kdart/pycopia/core/pycopia/cliutils.py/get_input