# Python を使用して PPSX ファイルをマージする

> Python で複数の PPSX ファイルをマージします。

Source: https://products.aspose.com/slides/ja/python-net/merge/ppsx/
Updated: 2023-04-07



## Python で PPSX をマージする

[**Aspose.Slides for Python via .NET**](https://products.aspose.com/slides/ja/python-net/) は、プレゼンテーション ファイルを作成および操作するための強力な Python ライブラリです。さらに、複数の PPSX プレゼンテーションを柔軟に組み合わせることができます。あるプレゼンテーションを別のプレゼンテーションにマージすると、それらのスライドを効果的に 1 つのプレゼンテーションに結合して 1 つのファイルを取得します。 Aspose.Slides では、2 つのプレゼンテーションを異なる方法でマージできます。品質やデータの損失を心配することなく、プレゼンテーションをすべての形状、スタイル、テキスト、書式、コメント、アニメーションなどと結合できます。

## Python を使用して PPSX ファイルをマージする

PowerPoint プレゼンテーションを結合するには、あるプレゼンテーションから別のプレゼンテーションにスライドを複製する必要があります。

### 複数の PPSX を 1 つのファイルにマージするための Python コード

```python

import aspose.slides as slides

with slides.Presentation("presentation1.ppsx") as pres1:
    with slides.Presentation("presentation2.ppsx") as pres2:
        for slide in pres2.slides:
            pres1.slides.add_clone(slide)
    pres1.save("presentation.ppsx", slides.export.SaveFormat.PPSX)
```

## Aspose.Slides for Python API を使用して PPSX をマージする方法

これらは、Python で 2 つの PPSX ファイルをマージし、結果を PPSX として保存する手順です。

[**Aspose.Slides for Python via .NET**](https://products.aspose.com/slides/ja/python-net/) をインストールします。
```
pip install aspose.slides
```

Python プロジェクトにライブラリ参照を追加 (ライブラリをインポート) します。
```
import aspose.slides as slides
```

Python でソース PPSX ファイルを開きます。
```
pres1 = slides.Presentation('pres1.ppsx')
pres2 = slides.Presentation('pres2.ppsx')
```

[**add_clone**](https://reference.aspose.com/slides/python-net/aspose.slides/islidecollection/#methods) メソッドを使用して PPSX ファイルを結合します。
```
for slide in pres2.slides:
    pres1.slides.add_clone(slide)
```

プレゼンテーションを保存し、結果を単一の PPSX ファイルとして取得します。
```
pres1.save("result.ppsx", slides.export.SaveFormat.PPSX)
```

## PPSX を他のサポートされている形式にエクスポート
