Load File from Local Disk

When source and target files are on the local disk, pass their paths directly to Comparer and add(). Both absolute and relative paths work.

Example: Load files from local disk

from groupdocs.comparison import Comparer

def load_file_from_local_disk():
    with Comparer("./source.docx") as comparer:
        comparer.add("./target.docx")
        comparer.compare("./result.docx")
        print("Documents compared successfully. Check output in result.docx.")

if __name__ == "__main__":
    load_file_from_local_disk()

source.docx is the source file used in this example. Click here to download it.

target.docx is the target file used in this example. Click here to download it.

Binary file (DOCX, 25 KB)

Download full output

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.