(msg, default=None)
return res
Ask for a non-null string input with an optional default value
Ask for a non-null string input with an optional default value
Ask for a non - null string input with an optional default value
def string_input(msg, default=None):
    """Ask for a non-null string input with an optional default value"""
    res = ""
    while (len(res) == 0):
        if (default is not None):
            assert (isinstance(default, str))
            res = _input(msg + ": [{}] ".format(default)) or default
        else:
            res = _input(msg + ": ")
    return res
def string_input ( msg , default = None ) : res = "" while ( len ( res ) == 0 ) : if ( default is not None ) : assert ( isinstance ( default , str ) ) res = _input ( msg + ": [{}] " . format ( default ) ) or default else : res = _input ( msg + ": " ) return res