def psome(obj, count):
    """
    The obj will printed only a number of count times.
    """
    global d
    key = inspect.stack()[1][1]+':'+str(inspect.stack()[1][2])
    d[key] = d.get(key,count) -1

    if d[key]>=0:
        print(obj)

    The obj will printed only a number of count times.
    
recipes/Python/578374_Print_object_only_limited_number/recipe-578374.py