def METHOD_NAME(filename = None):
    """Call this with a filename to make it the output file.
    Call it without arguments to close the current file (if necessary)
    and reset it to sys.stdout.
    """
    SetOutputFile()
    if filename:
        SetOutputFile(open(filename, 'w'), 1)