def write(path, text, append=True):
    """
    Writes the specified text to the specified file path.  If append=True is
    specified (the default), the file is not truncated when opened.
    """
    f = open(path, append and 'a' or 'w')
    f.write(text)
    f.close()
