def write_changelog(version2, version1=None, searchdir=None, flavor="", architecture=64, basedir=None):
    """Write changelog between version1 and version2 of WinPython."""
    searchdir = Path(searchdir) if searchdir else CHANGELOGS_DIR
    if basedir:
        copy_changelogs(version2, searchdir, flavor, architecture, basedir)
    changelog = compare_package_indexes(version2, version1, searchdir, flavor, architecture=architecture)
    output_file = searchdir / f"WinPython{flavor}-{architecture}bit-{version2}_History.md"
    with open(output_file, "w", encoding="utf-8") as f:
        f.write(changelog)
    if basedir:
        shutil.copyfile(output_file, Path(basedir) / output_file.name)
Write changelog between version1 and version2 of WinPython.
winpython/diff.py