# Load File from Stream Load source and target documents from open file streams to avoid persisting intermediate files, using GroupDocs.Comparison for Python via .NET. To avoid persisting intermediate files, work with file streams directly. Pass an open binary stream to `Comparer` and `add()`. 1. Open the source and target files as binary streams. 2. Pass the source stream to the `Comparer` constructor. 3. Pass the target stream to `add()`. 4. Call `compare()` with the result path or output stream. ## Example: Load files from streams {{< tabs "load-from-stream">}} {{< tab "load_file_from_stream.py" >}} ```python from groupdocs.comparison import Comparer def load_file_from_stream(): with open("./source.docx", "rb") as source_stream, \ open("./target.docx", "rb") as target_stream: with Comparer(source_stream) as comparer: comparer.add(target_stream) comparer.compare("./result.docx") print("Documents compared successfully. Check output in result.docx.") if __name__ == "__main__": load_file_from_stream() ``` {{< /tab >}} {{< tab "source.docx" >}} {{< tab-text >}} `source.docx` is the source file used in this example. Click [here](https://docs.groupdocs.com/comparison/python-net/_sample_files/developer-guide/loading-documents/load-file-from-stream/source.docx) to download it. {{< /tab-text >}} {{< /tab >}} {{< tab "target.docx" >}} {{< tab-text >}} `target.docx` is the target file used in this example. Click [here](https://docs.groupdocs.com/comparison/python-net/_sample_files/developer-guide/loading-documents/load-file-from-stream/target.docx) to download it. {{< /tab-text >}} {{< /tab >}} {{< tab "result.docx" >}} ```text Binary file (DOCX, 25 KB) ``` [Download full output](https://docs.groupdocs.com/comparison/python-net/_output_files/developer-guide/loading-documents/load-file-from-stream/load_file_from_stream/result.docx) {{< /tab >}} {{< /tabs >}}