def Printer(open_file=sys.stdout, closing=False):
    """ Prints items with a timestamp. """
    try:
        while True:
            logstr = (yield)
            open_file.write(logstr)
            open_file.write('\n') # new line
    except GeneratorExit:
        if closing:
            try: open_file.close()
            except: pass