This Python script allows users to create a PowerPoint presentation (.pptx) from a series of image files. Each image file is added to individual slides in the presentation. The dimensions of the presentation slides are automatically set based on the dimensions of the first image.
- Python 3.x
pptx
libraryPIL
(Python Imaging Library) for image processing
-
Ensure you have Python installed on your system. You can download it from Python's official website.
-
Install the required libraries using pip:
pip install python-pptx pillow
-
Place all the image files you want to include in the presentation in the same directory as the script.
-
Open a terminal or command prompt and navigate to the directory containing the script and image files.
-
Run the script using the following command:
python presentation_creator.py
-
The script will generate a PowerPoint presentation file named
Created_Presentaion.pptx
in the same directory.
- The script assumes that all image files in the directory are intended to be added to the presentation. Ensure that only the relevant image files are present in the directory.
- The layout of each slide in the presentation is determined by the layout at index 5 (
presentation.slide_layouts[5]
). You can modify this index to use a different layout as per your requirement.
- If there are any errors during the execution of the script, ensure that all dependencies are installed correctly and that the image files are accessible from the script's directory.
Suppose you have the following image files in your directory:
image1.PNG
image2.PNG
image3.PNG
Running the script will create a PowerPoint presentation (Created_Presentaion.pptx
) with each image on a separate slide.
python presentation_creator.py