<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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