def prompt(name, default=None):

    prompt = name + (default and ' [%s]' % default or '')
    prompt += name.endswith('?') and ' ' or ': '
    while True:
        rv = raw_input(prompt)
        if rv:
            return rv
        if default is not None:
            return default
Grab user input from command line.
dataset/ETHPy150Open danjac/Flask-Script/flaskext/script.py/prompt