def write_out(filename, data=b''):
    """
    write_out(path,str/bytes)

    like:
    write_out(r"c:.txt",data)
    """
    result = False
    try:
        with open(filename, 'wb') as f:
            if isinstance(data, str):
                f.write(data.encode('utf-8'))
            else:
                f.write(data)
        result = True
    except Exception as e:
        pass
    return result
