(*args, **kwargs)
return
Debug printing for iterated (list/tuple/dict/set) objects. args is
    of form (title1,object1,title2,object2,...) and prints:

        title1 = object1
        title2 = object2
        ...

    If you only wish to print a title set object = None.
Debug printing for iterated (list/tuple/dict/set) objects. args is
    of form (title1,object1,title2,object2,...) and prints:
Debug printing for iterated ( list / tuple / dict / set ) objects . args is of form ( title1 object1 title2 object2 ... ) and prints :
def oprint(*args, **kwargs):
    """
    Debug printing for iterated (list/tuple/dict/set) objects. args is
    of form (title1,object1,title2,object2,...) and prints:

        title1 = object1
        title2 = object2
        ...

    If you only wish to print a title set object = None.
    """

    if 'dict_mode' in kwargs:
        dict_mode = kwargs['dict_mode']
    else:
        dict_mode = False

    if isinstance(args[0], str) or args[0] is None:
        titles = list(islice(args, None, None, 2))
        objs = tuple(islice(args, 1, None, 2))
        if len(args) > 2:
            if objs[0] is None:
                n = 0
            else:
                n = len(titles[0])
            for (title, obj) in zip(titles[1:], objs[1:]):
                if obj is not None:
                    if not (dict_mode and isinstance(obj, dict)):
                        n = max(n, len(title))
        else:
            n = len(titles[0])

        for (title, obj) in zip(titles, objs):
            if obj is None:
                print(title)
            else:
                npad = n - len(title)
                if isinstance(obj, dict):
                    print(title + ':' + ostr(obj, dict_mode))
                else:
                    print(title + npad * ' ' + ' = ' + ostr(obj, dict_mode))
    else:
        for arg in args:
            print(ostr(arg, dict_mode))
    return
def oprint ( * args , * * kwargs ) : if 'dict_mode' in kwargs : dict_mode = kwargs [ 'dict_mode' ] else : dict_mode = False if isinstance ( args [ 0 ] , str ) or args [ 0 ] is None : titles = list ( islice ( args , None , None , 2 ) ) objs = tuple ( islice ( args , 1 , None , 2 ) ) if len ( args ) > 2 : if objs [ 0 ] is None : n = 0 else : n = len ( titles [ 0 ] ) for ( title , obj ) in zip ( titles [ 1 : ] , objs [ 1 : ] ) : if obj is not None : if not ( dict_mode and isinstance ( obj , dict ) ) : n = max ( n , len ( title ) ) else : n = len ( titles [ 0 ] ) for ( title , obj ) in zip ( titles , objs ) : if obj is None : print ( title ) else : npad = n - len ( title ) if isinstance ( obj , dict ) : print ( title + ':' + ostr ( obj , dict_mode ) ) else : print ( title + npad * ' ' + ' = ' + ostr ( obj , dict_mode ) ) else : for arg in args : print ( ostr ( arg , dict_mode ) ) return