def quote(string: str) -> str:
    """
    Wrap a string with quotes iff it contains a space. Used for interacting with command line scripts.
    :param string:
    :return:
    """
    if ' ' in string:
        return '"' + string + '"'
    return string