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

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

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



## Python で POTX をマージする

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

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

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

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

```python

import aspose.slides as slides

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

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

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

[**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 でソース POTX ファイルを開きます。
```
pres1 = slides.Presentation('pres1.potx')
pres2 = slides.Presentation('pres2.potx')
```

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

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

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