---
Product: Aspose.Slides
Platform: python
Page Type: kb
Canonical URL: https://kb.aspose.org/slides/python/how-to-add-animation-python
Last Updated: 2026-05-20
---

# Add Animation Python

Add Animation Python using Aspose.Slides FOSS for Python.

This guide shows how to add animation python using Aspose.Slides FOSS for Python.

---

## Prerequisites

| Requirement | Detail |
|-------------|--------|
| Runtime | Python |
| Package | `aspose-slides-foss` |
| Install | See the [Installation guide](https://docs.aspose.org/slides/python/getting-started/installation/) |

---

## Steps

1. Install the package:

```bash
pip install aspose-slides-foss
```

2. Use the `IAnimationTimeLine` class for the core operation.

```python
import aspose.slides_foss as slides
from aspose.slides_foss import ShapeType
from aspose.slides_foss import animation as anim
from aspose.slides_foss.export import SaveFormat

with slides.Presentation() as prs:
    slide = prs.slides[0]
    shape = slide.shapes.add_auto_shape(ShapeType.RECTANGLE, 10, 10, 100, 50)
    effect = slide.timeline.main_sequence.add_effect(
        shape, anim.EffectType.FADE,
        anim.EffectSubtype.NONE,
        anim.EffectTriggerType.ON_CLICK,
    )
    prs.save("animated.pptx", SaveFormat.PPTX)
```

---

## Tips and Best Practices

- Check the [API reference](https://reference.aspose.org/slides/python/) for the latest class signatures
- Handle file I/O exceptions when reading or writing files
- Dispose of resources properly after use

---

## Related Resources

- [Developer Guide](https://docs.aspose.org/slides/python/developer-guide/)
- [API Reference](https://reference.aspose.org/slides/python/)

## See Also

- [Aspose.Slides for Python — Enterprise Knowledge Base](https://kb.aspose.com/slides/python/)