def kwargs_to_string ( kwargs ) : outstr = '' for arg in kwargs : outstr += ' -{} {}' . format ( arg , kwargs [ arg ] ) return outstr
python args kwargs to string
Given a set of kwargs turns them into a string which can then be passed to a command . : param kwargs : kwargs from a function call . : return : outstr : A string which is if no kwargs were given and the kwargs in string format otherwise .
def kwargs_to_string(kwargs):
    """
    Given a set of kwargs, turns them into a string which can then be passed to a command.
    :param kwargs: kwargs from a function call.
    :return: outstr: A string, which is '' if no kwargs were given, and the kwargs in string format otherwise.
    """
    outstr = ''
    for arg in kwargs:
        outstr += ' -{} {}'.format(arg, kwargs[arg])
    return outstr