• Python Course
  • Python Basics
  • Interview Questions
  • Python Quiz
  • Popular Packages
  • Python Projects
  • Practice Python
  • AI With Python
  • Learn Python3
  • Python Automation
  • Python Web Dev
  • DSA with Python
  • Python OOPs
  • Dictionaries

Creating and updating PowerPoint Presentations in Python using python – pptx

python-pptx is library used to create/edit a PowerPoint (.pptx) files. This won’t work on MS office 2003 and previous versions.  We can add shapes, paragraphs, texts and slides and much more thing using this library.

Installation: Open the command prompt on your system and write given below command:

Let’s see some of its usage:

Example 1: Creating new PowerPoint file with title and subtitle slide.

               

Adding title and subtitle to the powerpoint

Example 2: Adding Text-Box in PowerPoint.

                           

Adding text box to the powerpoint

Example 3: PowerPoint (.pptx) file to Text (.txt) file conversion.

           

power point presentation on python

Example 4: Inserting image into the PowerPoint file.

                   

Adding images to the powerpoint

Example 5: Adding Charts to the PowerPoint file.

                   

Adding charts to the powerpoint

Example 6: Adding tables to the PowerPoint file.

           

Adding table to the powerpoint

Please Login to comment...

Similar reads.

  • python-modules
  • python-utility
  • How to Delete Discord Servers: Step by Step Guide
  • Google increases YouTube Premium price in India: Check our the latest plans
  • California Lawmakers Pass Bill to Limit AI Replicas
  • Best 10 IPTV Service Providers in Germany
  • 15 Most Important Aptitude Topics For Placements [2024]

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

  • Open Source

How To Create PowerPoint Presentations With Python From Command Line

Automating the process of creating simple powerpoint slides with python-pptx library..

This Step-by-Step guide demonstrates how to use Python and the python-pptx library to create PowerPoint presentations from command line.

The steps and code provided in this guide are not specific to any particular operating system and should work on all major platforms, including Linux, macOS, and Windows.

Table of Contents

What is Python-pptx, by the way?

The python-pptx library is an open-source Python library that allows you to create, read, and update PowerPoint (.pptx) files.

The python-pptx library is particularly well-suited for generating PowerPoint presentations dynamically from various data sources as listed below:

  • Database Queries : By connecting to a database and executing queries, you can fetch data and use the python-pptx library to generate PowerPoint slides with visualizations, charts, or tables based on the queried data. This approach can be useful for creating data-driven presentations or reports.
  • Analytics Outputs : If you have analytics software or scripts that generate structured data or insights, you can use the python-pptx library to transform that data into visually appealing PowerPoint slides, complete with charts, graphs, and other visual elements.
  • JSON Payloads : With the increasing prevalence of APIs and web services, it's common to receive data in JSON format. The python-pptx library can be used to parse JSON payloads and dynamically create PowerPoint slides based on the structured data contained within them.
  • HTTP Requests : By integrating the python-pptx library into a web application or API, you can generate PowerPoint presentations on-the-fly in response to HTTP requests. This allows for the creation of dynamic, customized presentations tailored to specific user inputs or data sources.

The python-pptx library runs on any Python-capable platform, including Linux, macOS, and Windows.

Another significant benefit of the python-pptx library is that it does not require the PowerPoint application to be installed on the system where the code is running.

Now let us discuss how to automate the process of creating simple PowerPoint presentations using python-pptx library .

Create PowerPoint Presentations using Python

The process is divided into three straightforward steps: installing the required software, creating the Python script, and running the script to produce the presentation file.

Step 1 - Installing Prerequisites

Before proceeding, ensure that you have Python installed on your system.

Python is pre-installed in most Linux operating systems. If not, you can install it using the following command on Debian-based systems:

On Red-hat based systems, run:

Next, install the python-pptx library, which provides the necessary functionality to create PowerPoint presentations programmatically. You can install it using pip , Python's package installer:

Step 2 - Creating the Python Script

Create a new Python script (e.g., create_ppt.py ):

and copy the following code into it:

Edit the script and update the title, content of the slides and the output file as you wish. Once done, save the file and close it.

Explanation of the Script:

This script creates a new PowerPoint presentation and adds four slides: a title slide , and three content slides covering the importance of Linux security , common security practices , and security tools .

Title Slide :

The script initializes a new Presentation object and adds a title slide with the main title "Linux Security Automation" and the subtitle "An overview of securing Linux systems".

Content Slides :

The script then adds three content slides, each with a title and bullet points covering different aspects of Linux security:

  • Slide 1: Importance of Linux Security (e.g., protecting against unauthorized access, ensuring data integrity, maintaining system availability, and protecting sensitive information).
  • Slide 2: Common Security Practices (e.g., regularly updating and patching the system, using strong passwords, enabling firewalls, using antivirus software, and monitoring system logs).
  • Slide 3: Security Tools (e.g., SELinux/AppArmor for Mandatory Access Control, ClamAV for antivirus protection, Fail2Ban for preventing brute force attacks, and UFW for an uncomplicated firewall).

Saving the Presentation :

Finally, the script saves the PowerPoint presentation as Linux_Security_Presentation.pptx in the current directory.

Step 3 - Generate PowerPoint Slides

Navigate to the directory containing the script in your terminal and run the following command:

This command will execute the script, and generate a new PowerPoint file named " Linux_Security_Presentation.pptx " in the same directory.

Step 4 - Run or Customize PPTs

As I mentioned, this script will only create simple PowerPoint presentations . They are plain with white background.

Here is a sample PPT slide that I created using this script:

A Powerpoint Slide Created with Python

You can open it with any PowerPoint application (For example LibreOffice Impress or MS PowerPoint ) and customize the look of the slides as per your own liking.

Here's how the slide looks like after I changed its background and added our blog's logo on the top of the slide:

A Powerpoint Slide Created with Python-pptx Library

This script serves as a basic example, and you can further enhance it by adding more slides, customizing the content, or incorporating additional features, such as adding images, charts, or formatting options.

You get the idea. Use our script as a starting point. Customize it and be creative. You can make the slides more elegant and professional.

  • https://pypi.org/project/python-pptx/

' data-src=

Senthilkumar Palani (aka SK) is the Founder and Editor in chief of OSTechNix. He is a Linux/Unix enthusiast and FOSS supporter. He lives in Tamilnadu, India.

Alpine Linux 3.20.0 Released With Initial 64-bit RISC-V Support

Tuxedo stellaris slim 15 is available for pre-order, you may also like, install anaconda python distribution on linux, display network information in linux using what ip..., find linux system details using python, build fast, scalable web apps with python using..., please – a simple command line todo manager, monitor system resources with bashtop and bpytop in..., leave a comment cancel reply.

Save my name, email, and website in this browser for the next time I comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed .

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More

  • Mailing List

Practical Business Python

Taking care of business, one python script at a time

Creating Powerpoint Presentations with Python

Posted by Chris Moffitt in articles   

Introduction

Love it or loathe it, PowerPoint is widely used in most business settings. This article will not debate the merits of PowerPoint but will show you how to use python to remove some of the drudgery of PowerPoint by automating the creation of PowerPoint slides using python.

Fortunately for us, there is an excellent python library for creating and updating PowerPoint files: python-pptx . The API is very well documented so it is pretty easy to use. The only tricky part is understanding the PowerPoint document structure including the various master layouts and elements. Once you understand the basics, it is relatively simple to automate the creation of your own PowerPoint slides. This article will walk through an example of reading in and analyzing some Excel data with pandas, creating tables and building a graph that can be embedded in a PowerPoint file.

PowerPoint File Basics

Python-pptx can create blank PowerPoint files but most people are going to prefer working with a predefined template that you can customize with your own content. Python-pptx’s API supports this process quite simply as long as you know a few things about your template.

Before diving into some code samples, there are two key components you need to understand: Slide Layouts and Placeholders . In the images below you can see an example of two different layouts as well as the template’s placeholders where you can populate your content.

In the image below, you can see that we are using Layout 0 and there is one placeholder on the slide at index 1.

PowerPoint Layout 0

In this image, we use Layout 1 for a completely different look.

PowerPoint Layout 1

In order to make your life easier with your own templates, I created a simple standalone script that takes a template and marks it up with the various elements.

I won’t explain all the code line by line but you can see analyze_ppt.py on github. Here is the function that does the bulk of the work:

The basic flow of this function is to loop through and create an example of every layout included in the source PowerPoint file. Then on each slide, it will populate the title (if it exists). Finally, it will iterate through all of the placeholders included in the template and show the index of the placeholder as well as the type.

If you want to try it yourself:

Refer to the input and output files to see what you get.

Creating your own PowerPoint

For the dataset and analysis, I will be replicating the analysis in Generating Excel Reports from a Pandas Pivot Table . The article explains the pandas data manipulation in more detail so it will be helpful to make sure you are comfortable with it before going too much deeper into the code.

Let’s get things started with the inputs and basic shell of the program:

After we create our command line args, we read the source Excel file into a pandas DataFrame. Next, we use that DataFrame as an input to create the Pivot_table summary of the data:

Consult the Generating Excel Reports from a Pandas Pivot Table if this does not make sense to you.

The next piece of the analysis is creating a simple bar chart of sales performance by account:

Here is a scaled down version of the image:

PowerPoint Graph

We have a chart and a pivot table completed. Now we are going to embed that information into a new PowerPoint file based on a given PowerPoint template file.

Before I go any farther, there are a couple of things to note. You need to know what layout you would like to use as well as where you want to populate your content. In looking at the output of analyze_ppt.py we know that the title slide is layout 0 and that it has a title attribute and a subtitle at placeholder 1.

Here is the start of the function that we use to create our output PowerPoint:

This code creates a new presentation based on our input file, adds a single slide and populates the title and subtitle on the slide. It looks like this:

PowerPoint Title Slide

Pretty cool huh?

The next step is to embed our picture into a slide.

From our previous analysis, we know that the graph slide we want to use is layout index 8, so we create a new slide, add a title then add a picture into placeholder 1. The final step adds a subtitle at placeholder 2.

Here is our masterpiece:

PowerPoint Chart

For the final portion of the presentation, we will create a table for each manager with their sales performance.

Here is an image of what we’re going to achieve:

PowerPoint Table

Creating tables in PowerPoint is a good news / bad news story. The good news is that there is an API to create one. The bad news is that you can’t easily convert a pandas DataFrame to a table using the built in API . However, we are very fortunate that someone has already done all the hard work for us and created PandasToPowerPoint .

This excellent piece of code takes a DataFrame and converts it to a PowerPoint compatible table. I have taken the liberty of including a portion of it in my script. The original has more functionality that I am not using so I encourage you to check out the repo and use it in your own code.

The code takes each manager out of the pivot table and builds a simple DataFrame that contains the summary data. Then uses the df_to_table to convert the DataFrame into a PowerPoint compatible table.

If you want to run this on your own, the full code would look something like this:

All of the relevant files are available in the github repository .

One of the things I really enjoy about using python to solve real world business problems is that I am frequently pleasantly surprised at the rich ecosystem of very well thought out python tools already available to help with my problems. In this specific case, PowerPoint is rarely a joy to use but it is a necessity in many environments.

After reading this article, you should know that there is some hope for you next time you are asked to create a bunch of reports in PowerPoint. Keep this article in mind and see if you can find a way to automate away some of the tedium!

  • ← Best Practices for Managing Your Code Library
  • Adding a Simple GUI to Your Pandas Script →

Subscribe to the mailing list

Submit a topic.

  • Suggest a topic for a post
  • Pandas Pivot Table Explained
  • Common Excel Tasks Demonstrated in Pandas
  • Overview of Python Visualization Tools
  • Guide to Encoding Categorical Values in Python
  • Overview of Pandas Data Types

Article Roadmap

We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.

PSF Supporting Member

5 Best Ways to Create PowerPoint Files Using Python

💡 Problem Formulation: Automating the creation of PowerPoint presentations is a common task for those who need to generate reports or summaries regularly. For instance, a user may wish to create a presentation summarizing sales data from a CSV file or visualize a project’s progress in a structured format. The desired output is a fully formatted PowerPoint file (.pptx) with various elements like titles, texts, images, and charts, as specified by the input data or customization requirements.

Method 1: Using python-pptx

The python-pptx library provides a comprehensive set of features for creating PowerPoint files (.pptx) in Python. It allows for adding slides, text, images, charts, and more, with a high level of customization. Manipulate slides at a granular level by accessing placeholders, creating bulleted lists, and setting properties like font size or color programmatically.

Here’s an example:

The code snippet above creates a PowerPoint file named python-pptx-presentation.pptx with one slide that includes a title and a subtitle.

In this overview, we create a presentation object, add a new slide with a predefined layout, set text for the title and subtitle placeholders, and then save the presentation. This method gives users the ability to create detailed, professional presentations through code.

Method 2: Using Pandas with python-pptx

This method combines the data manipulation power of Pandas with the presentation capabilities of python-pptx to create PowerPoint files from DataFrame contents. It’s particularly useful for automating the inclusion of tabular data or creating charts based on the DataFrame’s data.

The output is a PowerPoint file named pandas-python-pptx.pptx containing a bar chart representing the quantity of fruits.

This snippet demonstrates using a Pandas DataFrame to generate chart data, which is then used to create a chart in a PowerPoint slide. It showcases the synergy between Pandas for data handling and python-pptx for presentation creation.

Method 3: Using ReportLab with python-pptx

Those seeking to include complex graphics or generate custom visuals can harness the graphic-drawing capabilities of ReportLab with python-pptx. This method leverages ReportLab to create an image, which can then be inserted into a PowerPoint slide.

The output would be a PowerPoint file named reportlab-pptx.pptx containing a slide with a custom bar chart image.

The code above creates a bar chart using ReportLab, saves the chart as an image, and then inserts the image into a PowerPoint slide. This approach is ideal if you need to include bespoke graphics that are not directly supported by python-pptx itself.

Method 4: Using Matplotlib with python-pptx

For those familiar with Matplotlib, this method involves creating a visual plot or chart with Matplotlib, saving it as an image, and then embedding the image into a PowerPoint slide using python-pptx.

The outcome is a PowerPoint file matplotlib-pptx.pptx , with a plot on a slide created by Matplotlib.

In this case, we graph a quadratic function using Matplotlib, save it as an image, and then add that image to a slide in our PowerPoint presentation. This method offers a blend of Matplotlib’s sophisticated plotting tools with the simplicity of python-pptx.

Bonus One-Liner Method 5: Using Officegen

The Officegen package allows for rapid PowerPoint creation with simpler syntax, although with less flexibility compared to python-pptx. It provides functions to add slides, titles, and bullet points.

The outcome is a PowerPoint file officegen-presentation.pptx with a single slide containing a large title.

This snippet uses Officegen to initiate a new presentation, adds a text title to a slide, and saves the presentation. While not as detailed as python-pptx, Officegen is quick for simple presentations.

Summary/Discussion

  • Method 1: python-pptx. Full-featured control over presentations. Can be verbose for simple tasks.
  • Method 2: Pandas with python-pptx. Ideal for data-driven presentations. Setup can be complex if unfamiliar with data libraries.
  • Method 3: ReportLab with python-pptx. Powerful combo for custom graphics. Requires separate handling of graphics and presentation stages.
  • Method 4: Matplotlib with python-pptx. Best for users comfortable with Matplotlib. Less direct than using python-pptx alone.
  • Bonus Method 5: Officegen. Quick and easy for simple presentations. Limited customization options.

Spire.Presentation-for-Python 8.8.0

pip install Spire.Presentation-for-Python Copy PIP instructions

Released: Aug 7, 2023

A 100% standalone Power Point Python API for Processing Power Point Files

Verified details  (What is this?)

Maintainers.

Avatar for E-iceblue from gravatar.com

Unverified details

Project links.

  • License: Free To Use But Restricted, Other/Proprietary License
  • Author: E-iceblue
  • Requires: Python >=3.9

Classifiers

  • Free To Use But Restricted
  • Other/Proprietary License
  • Microsoft :: Windows
  • POSIX :: Linux
  • Python :: 3.6

Project description

Standalone powerpoint compatible python api for efficient presentation handling.

power point presentation on python

Product Page | Documentation | Examples | Forum | Temporary License | Customized Demo

Spire.Presentation for Python is a comprehensive PowerPoint compatible API designed for developers to efficiently create, modify, read, and convert PowerPoint files within Python programs. It offers a broad spectrum of functions to manipulate PowerPoint documents without any external dependencies.

Spire.Presentation for Python supports a wide range of PowerPoint features, such as adding and formatting text, tables, charts, images, shapes, and other objects, inserting and modifying animations, transitions, and slide layouts, generating and managing master slides, and many more.

This professional Python API also enables developers to easily convert PowerPoint files to various formats with high quality, including PDF, SVG, image, HTML, XPS, and more.

Support for Various PowerPoint Versions

  • PPT - PowerPoint Presentation 97-2003
  • PPS - PowerPoint SlideShow 97-2003
  • PPTX - PowerPoint Presentation 2007/2010/2013/2016/2019
  • PPSX - PowerPoint SlideShow 2007, 2010

High-Quality and Efficient PowerPoint File Conversion

Spire.Presentation for Python allows conversion from PowerPoint files to images, PDF, HTML, XPS, and SVG and interconversion between PowerPoint Presentation formats.

Support for Rich Presentation Manipulation Features

  • Work with PowerPoint Charts
  • Print PowerPoint Presentations
  • Work with SmartArtImages and Shapes
  • Audio and Video
  • Protect Presentation Slides
  • Text and Image Watermark
  • Merge Split PowerPoint Document
  • Comments and Notes
  • Manage PowerPoint Tables
  • Set Animations on Shapes
  • Manage Hyperlink
  • Extract Text and Image
  • Replace Text

Create a PowerPoint document in Python

Convert powerpoint files to pdf, convert powerpoint files to images, set passwords for powerpoint presentations, project details, release history release notifications | rss feed.

Aug 7, 2023

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages .

Source Distributions

Built distribution.

Uploaded Aug 7, 2023 Python 3 Windows x86-64

Hashes for Spire.Presentation_for_Python-8.8.0-py3-none-win_amd64.whl

Hashes for Spire.Presentation_for_Python-8.8.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256
MD5
BLAKE2b-256
  • português (Brasil)

Supported by

power point presentation on python

Navigation Menu

Search code, repositories, users, issues, pull requests..., provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications You must be signed in to change notification settings

Create Open XML PowerPoint documents in Python

scanny/python-pptx

Folders and files.

NameName
2,137 Commits
workflows workflows
pptx pptx

Repository files navigation

python-pptx is a Python library for creating, reading, and updating PowerPoint (.pptx) files.

A typical use would be generating a PowerPoint presentation from dynamic content such as a database query, analytics output, or a JSON payload, perhaps in response to an HTTP request and downloading the generated PPTX file in response. It runs on any Python capable platform, including macOS and Linux, and does not require the PowerPoint application to be installed or licensed.

It can also be used to analyze PowerPoint files from a corpus, perhaps to extract search indexing text and images.

In can also be used to simply automate the production of a slide or two that would be tedious to get right by hand, which is how this all got started.

More information is available in the python-pptx documentation .

Browse examples with screenshots to get a quick idea what you can do with python-pptx.

Used by 15.1k

@presbrey

Contributors 8

  • Python 94.4%
  • Gherkin 5.5%
  • Makefile 0.1%
  • Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers
  • Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand
  • OverflowAI GenAI features for Teams
  • OverflowAPI Train & fine-tune LLMs
  • Labs The future of collective knowledge sharing
  • About the company Visit the blog

Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Get early access and see previews of new features.

How can I automate the generation of a powerpoint with python

Let's say I have a list of students (names) and their corresponding photos, as well as some grades for the students. How can I insert the student's desired photo as a background picture for some or all of the slides, insert their names on JUST the title slide and insert their grades on select slides?

How should I go about this in python if I want to edit a base template powerpoint for each student with their corresponding information?

Froopy's user avatar

  • 2 What have you tried so far? –  Klaus D. Commented Mar 5, 2022 at 4:15
  • Welcome to Stack Overflow. This isn't a place to get free application design or tutorials. Do you have a Python package picked out that helps you do this? Does that package work on its own or does it work with a Powerpoint app? You need to first pick the package you'll use to do this (I assume there is at least one.). Then you need to study that package's documentation to work out all of the steps needed to do what you want to do. This is programming. If you want to be a programmer, doing this sort of research and study is a big part of that. –  CryptoFool Commented Mar 5, 2022 at 4:21
  • Please provide enough code so others can better understand or reproduce the problem. –  Community Bot Commented Mar 5, 2022 at 7:15

You can use python-pptx library. It is a Python library for creating and updating PowerPoint (.pptx) files.

This includes:

Round-trip any Open XML presentation (.pptx file) including all its elements Add slides Populate text placeholders, for example to create a bullet slide Add image to slide at arbitrary position and size Add textbox to a slide; manipulate text font size and bold Add table to a slide Add auto shapes (e.g. polygons, flowchart shapes, etc.) to a slide Add and manipulate column, bar, line, and pie charts Access and change core document properties such as title and subject

Link for download: https://pypi.org/project/python-pptx/

Link for documentation: https://python-pptx.readthedocs.io/en/latest/

Jamolkhon Akhmedov's user avatar

  • 1 Thank you for pointing me in the right direction! –  Froopy Commented Mar 6, 2022 at 3:24

Your Answer

Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more

Sign up or log in

Post as a guest.

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy .

Not the answer you're looking for? Browse other questions tagged python powerpoint or ask your own question .

  • The Overflow Blog
  • Mobile Observability: monitoring performance through cracked screens, old...
  • Featured on Meta
  • Announcing a change to the data-dump process
  • Bringing clarity to status tag usage on meta sites
  • What does a new user need in a homepage experience on Stack Overflow?
  • Feedback requested: How do you use tag hover descriptions for curating and do...
  • Staging Ground Reviewer Motivation

Hot Network Questions

  • Word to describe telling yourself that you are not, and will never be, good enough
  • How specific does the GDPR require you to be when providing personal information to the police?
  • What is the relation between rope length, object weight and force needed?
  • Doesn't counting hole and electron current lead to double-counting of actual current?
  • Seinfeldisms in O.R
  • Does measuring a quantum object collapse the wave function even if the particle is not found in the position where it was measured?
  • A SF novel where one character makes a "light portrait" of another one, with huge consequences
  • Can LLMs be prompted without fine tuning?
  • What is the difference between "Hubiera" and "Habría"?
  • Best way to explain the thinking steps from x^2 = 9 to x=±3
  • Can you use 'sollen' the same way as 'should' in sentences about possibility that something happens?
  • A strange Lipschitz function
  • If you switch to a non-orthogonal basis, are vectors that were previously orthogonal still orthogonal?
  • If Starliner returns safely on autopilot, can this still prove that it's safe? Could it be launched back up to the ISS again to complete its mission?
  • How can I Align an existing Object to the 3D Viewport's XY Plane?
  • if God is a singular being or entity , why did He use the phrase us before creating man?
  • How do I get GUI wokring for Ubuntu linux, How do I go about " searching your distribtion's package database for the file missing"?
  • What is a "hard-boiled turtle-slapper"?
  • Can an international student email a professor at a foreign university for an internship opportunity?
  • Integration by parts for twice differentiable functions
  • Does it pay to put effort in fixing this problem or better reinstall Ubuntu 24.04 from scratch?
  • In 1982 Admiral Grace Hopper said "I still haven't found out why helicopter rotors go the way they do". If she were here today, how might one answer?
  • How to Construct Phonotactics?
  • Barnum Effectus

power point presentation on python

  • International
  • Education Jobs
  • Schools directory
  • Resources Education Jobs Schools directory News Search

Beginners to Python Programming - Lesson 2

Beginners to Python Programming - Lesson 2

Subject: Computing

Age range: Age not applicable

Resource type: Lesson (complete)

Computer Science Education

Last updated

28 August 2024

  • Share through email
  • Share through twitter
  • Share through linkedin
  • Share through facebook
  • Share through pinterest

power point presentation on python

An Introduction to Python Lesson Two. This is the 2nd lesson in a series of 7 one-hour lessons, with full class presentation, lesson plan, and with fully tested codes for any teacher who has little experience of coding, or wants to jump straight in. Easy to follow programming, with all codes supplied and tailor-made videos, to make teaching Python programming effortless.

This lesson covers:

  • Introduction to Python and IDLE
  • Declaring data types in code
  • The purpose of comments
  • Using casting
  • Understanding program cases
  • Global and Local variables

This Introduction to Python lesson is created to enable you to jump straight in with absolutely no specialist background whatsoever.

This lesson has been created to be 1 hour in length. However, this can be broken down due to the nature of the presentation and is fully editable for teacher use. This is suitable for secondary education and for home schooling, but can be used for younger children, where applicable, or older learners with little Python experience.

This package includes:

Extensive presentation Full lesson plan Full and extensive codes (no need to code yourself) Practice session at the end of the lesson, this can be used for homework

Tes paid licence How can I reuse this?

Your rating is required to reflect your happiness.

It's good to leave some feedback.

Something went wrong, please try again later.

This resource hasn't been reviewed yet

To ensure quality for our reviews, only customers who have purchased this resource can review it

Report this resource to let us know if it violates our terms and conditions. Our customer service team will review your report and will be in touch.

Not quite what you were looking for? Search by keyword to find the right resource:

  • python-pptx 1.0.0 documentation »

python-pptx ¶

Release v1.0.0 ( Installation )

python-pptx is a Python library for creating, reading, and updating PowerPoint (.pptx) files.

A typical use would be generating a PowerPoint presentation from dynamic content such as a database query, analytics output, or a JSON payload, perhaps in response to an HTTP request and downloading the generated PPTX file in response. It runs on any Python capable platform, including macOS and Linux, and does not require the PowerPoint application to be installed or licensed.

It can also be used to analyze PowerPoint files from a corpus, perhaps to extract search indexing text and images.

In can also be used to simply automate the production of a slide or two that would be tedious to get right by hand, which is how this all got started.

More information is available in the python-pptx documentation .

Browse examples with screenshots to get a quick idea what you can do with python-pptx.

Philosophy ¶

python-pptx aims to broadly support the PowerPoint format (PPTX, PowerPoint 2007 and later), but its primary commitment is to be industrial-grade , that is, suitable for use in a commercial setting. Maintaining this robustness requires a high engineering standard which includes a comprehensive two-level (e2e + unit) testing regimen. This discipline comes at a cost in development effort/time, but we consider reliability to be an essential requirement.

Feature Support ¶

python-pptx has the following capabilities:

  • Round-trip any Open XML presentation (.pptx file) including all its elements
  • Populate text placeholders, for example to create a bullet slide
  • Add image to slide at arbitrary position and size
  • Add textbox to a slide; manipulate text font size and bold
  • Add table to a slide
  • Add auto shapes (e.g. polygons, flowchart shapes, etc.) to a slide
  • Add and manipulate column, bar, line, and pie charts
  • Access and change core document properties such as title and subject
  • And many others …

Even with all python-pptx does, the PowerPoint document format is very rich and there are still features python-pptx does not support.

New features/releases ¶

New features are generally added via sponsorship. If there’s a new feature you need for your use case, feel free to reach out at the email address on the github.com/scanny profile page. Many of the most used features such as charts were added this way.

User Guide ¶

Introduction

  • Getting Started
  • Working with Presentations
  • Working with Slides
  • Understanding Shapes
  • Working with AutoShapes
  • Understanding placeholders
  • Working with placeholders
  • Working with text
  • Working with charts
  • Working with tables
  • Working with Notes Slides

Community Guide ¶

  • Frequently Asked Questions
  • Software Updates

API Documentation ¶

  • Presentation function
  • Presentation objects
  • CoreProperties objects
  • Slides objects
  • Slide objects
  • SlideLayouts objects
  • SlideLayout objects
  • SlideMasters objects
  • SlideMaster objects
  • SlidePlaceholders objects
  • NotesSlide objects
  • SlideShapes objects
  • GroupShapes objects
  • Shape objects in general
  • Shape objects (AutoShapes)
  • Connector objects
  • FreeformBuilder objects
  • Picture objects
  • GraphicFrame objects
  • GroupShape objects
  • MasterPlaceholder objects
  • LayoutPlaceholder objects
  • ChartPlaceholder objects
  • PicturePlaceholder objects
  • TablePlaceholder objects
  • PlaceholderGraphicFrame objects
  • PlaceholderPicture objects
  • _PlaceholderFormat objects
  • Table objects
  • _Column objects
  • _Row objects
  • _Cell objects
  • ChartData objects
  • Chart objects
  • Legend objects
  • Axis objects
  • MajorGridlines objects
  • TickLabels objects
  • _BasePlot objects
  • DataLabels objects
  • Series objects
  • Point objects
  • TextFrame objects
  • Font objects
  • _Paragraph objects
  • _Run objects
  • ActionSetting objects
  • Hyperlink objects
  • ChartFormat objects
  • FillFormat objects
  • LineFormat objects
  • ColorFormat objects
  • RGBColor objects
  • ShadowFormat objects
  • Image objects
  • util Module
  • MSO_AUTO_SHAPE_TYPE
  • MSO_AUTO_SIZE
  • MSO_COLOR_TYPE
  • MSO_CONNECTOR_TYPE
  • MSO_FILL_TYPE
  • MSO_LANGUAGE_ID
  • MSO_LINE_DASH_STYLE
  • MSO_PATTERN_TYPE
  • MSO_SHAPE_TYPE
  • MSO_TEXT_UNDERLINE_TYPE
  • MSO_THEME_COLOR_INDEX
  • MSO_VERTICAL_ANCHOR
  • PP_ACTION_TYPE
  • PP_MEDIA_TYPE
  • PP_PARAGRAPH_ALIGNMENT
  • PP_PLACEHOLDER_TYPE
  • XL_AXIS_CROSSES
  • XL_CATEGORY_TYPE
  • XL_CHART_TYPE
  • XL_DATA_LABEL_POSITION
  • XL_LEGEND_POSITION
  • XL_MARKER_STYLE
  • XL_TICK_LABEL_POSITION
  • XL_TICK_MARK
  • Excel Number Formats

Contributor Guide ¶

  • Running the test suite
  • Understanding xmlchemy
  • Development Practices

Table of Contents

  • Feature Support
  • New features/releases
  • Community Guide
  • API Documentation
  • Contributor Guide

Useful Links

  • python-pptx @ GitHub
  • python-pptx @ PyPI
  • Issue Tracker

Quick search

IMAGES

  1. PPT

    power point presentation on python

  2. Python_Seminar.ppt

    power point presentation on python

  3. PPT

    power point presentation on python

  4. Python PPT Presentation Template and Google Slides

    power point presentation on python

  5. PPT

    power point presentation on python

  6. PPT

    power point presentation on python

VIDEO

  1. Image animation in PowerPoint #powerpointpresenation #designtutorials

  2. 3D points (PLY file) visualization using Python Point Processing Toolkit (PPTK)

  3. Добавление графика в PowerPoint с помощью python

  4. Create Stunning PowerPoint Presentations with Python and ChatGPT

  5. Microsoft introduces Python in Excel

  6. Создание PowerPoint файла и слайдов с помощью python

COMMENTS

  1. Creating and updating PowerPoint Presentations in Python using python

    Installation: Open the command prompt on your system and write given below command: pip install python-pptx. Let's see some of its usage: Example 1: Creating new PowerPoint file with title and subtitle slide. Python3. from pptx import Presentation .

  2. Automate PowerPoint Slides Creation with Python

    II. Process Data and Design Slides with Python. You can find the source code with dummy data here: Github. Let us explore all the steps to generate your final report. Steps to create your operational report on PowerPoint — (Image by Author) 1. Data Extraction. Connect to your WMS and extract shipment records.

  3. python-pptx · PyPI

    python-pptx is a Python library for creating, reading, and updating PowerPoint (.pptx) files. A typical use would be generating a PowerPoint presentation from dynamic content such as a database query, analytics output, or a JSON payload, perhaps in response to an HTTP request and downloading the generated PPTX file in response. It runs on any ...

  4. python-pptx

    python-pptx¶. Release v1.0.0 (Installation)python-pptx is a Python library for creating, reading, and updating PowerPoint (.pptx) files.. A typical use would be generating a PowerPoint presentation from dynamic content such as a database query, analytics output, or a JSON payload, perhaps in response to an HTTP request and downloading the generated PPTX file in response.

  5. How To Create PowerPoint Presentations With Python

    Step 2 - Creating the Python Script. Create a new Python script (e.g., create_ppt.py): $ nano create_ppt.py. and copy the following code into it: from pptx import Presentation. from pptx.util import Inches. # Create a new presentation object. presentation = Presentation() # Title Slide.

  6. Spire.Presentation · PyPI

    Spire.Presentation for Python is a comprehensive PowerPoint compatible API designed for developers to efficiently create, modify, read, and convert PowerPoint files within Python programs. It offers a broad spectrum of functions to manipulate PowerPoint documents without any external dependencies. Spire.Presentation for Python supports a wide ...

  7. How to use Python with PowerPoint (small demo). Create PP presentations

    A little walk through of the Python-pptx package which enables you to create PowerPoint slides and presentation using Python. In this demo we make 5 slides: ...

  8. Create a PowerPoint Document Using Python: A

    Jan 23, 2024. Creating a PowerPoint document using Python allows you to automate the process of generating professional presentations with ease. By leveraging libraries such as Spire.Presentation ...

  9. Using 'python-pptx' To Programmatically Create PowerPoint Slides

    Steve Canny's python-pptx is a great library for getting started using Python to create dynamic PowerPoint slides. PowerPoint presentations are often short, sweet, and full of pictures and other ...

  10. Creating Powerpoint Presentations with Python

    Here is the start of the function that we use to create our output PowerPoint: def create_ppt(input, output, report_data, chart): """ Take the input powerpoint file and use it as the template for the output file. """ prs = Presentation(input) # Use the output from analyze_ppt to understand which layouts and placeholders # to use # Create a ...

  11. 5 Best Ways to Create PowerPoint Files Using Python

    The outcome is a PowerPoint file officegen-presentation.pptx with a single slide containing a large title. This snippet uses Officegen to initiate a new presentation, adds a text title to a slide, and saves the presentation. While not as detailed as python-pptx, Officegen is quick for simple presentations. Summary/Discussion. Method 1: python-pptx.

  12. Spire.Presentation-for-Python · PyPI

    Spire.Presentation for Python is a comprehensive PowerPoint compatible API designed for developers to efficiently create, modify, read, and convert PowerPoint files within Python programs. It offers a broad spectrum of functions to manipulate PowerPoint documents without any external dependencies. Spire.Presentation for Python supports a wide ...

  13. Working with Presentations

    Opening a presentation ¶. The simplest way to get started is to open a new presentation without specifying a file to open: from pptx import Presentation prs = Presentation() prs.save('test.pptx') This creates a new presentation from the built-in default template and saves it unchanged to a file named 'test.pptx'. A couple things to note:

  14. Creating Presentations with Python

    python-pptx is a Python library for creating and updating PowerPoint files. This article is going to be a basic introduction to this package. If you want to learn much more about it, this is the official documentation page that you should check. Now let's install the package if you don't have. pip install python-pptx.

  15. Create PowerPoint Presentations With Python

    In this tutorial I will be showing you how to create POWERPOINT PRESENTATIONS using only Python. This tutorial provides a step-by-step walk-through made to h...

  16. Using Python to Update PowerPoint

    Before using Python to edit PowerPoint, you need to have the python-pptx package. To install it, you can type the following code in the terminal. ... from pptx import Presentation from pptx.util import Inches import win32com.client import os currencies_ppt = Presentation('Currencies.pptx') slide = currencies_ppt.slides[0] ...

  17. scanny/python-pptx: Create Open XML PowerPoint documents in Python

    MIT license. python-pptx is a Python library for creating, reading, and updating PowerPoint (.pptx) files. A typical use would be generating a PowerPoint presentation from dynamic content such as a database query, analytics output, or a JSON payload, perhaps in response to an HTTP request and downloading the generated PPTX file in response.

  18. Free PPT Slides for Python Programming

    Introduction To Python Programming. Python Programming (58 Slides) 97729 Views. Unlock a Vast Repository of Python Programming PPT Slides, Meticulously Curated by Our Expert Tutors and Institutes. Download Free and Enhance Your Learning!

  19. Create or Extract Tables in PowerPoint Presentations with Python

    Spire.Presentation for Python is a feature-rich and user-friendly library that enables creating, reading, editing, and converting PowerPoint presentations within Python applications.

  20. How can I automate the generation of a powerpoint with python

    6. You can use python-pptx library. It is a Python library for creating and updating PowerPoint (.pptx) files. This includes: Round-trip any Open XML presentation (.pptx file) including all its elements Add slides Populate text placeholders, for example to create a bullet slide Add image to slide at arbitrary position and size Add textbox to a ...

  21. Working with Slides

    The presentation themes that come with PowerPoint have about nine slide layouts, with names like Title, Title and Content, Title Only, and Blank. Each has zero or more placeholders (mostly not zero), preformatted areas into which you can place a title, multi-level bullets, an image, etc. ... In python-pptx, these are prs.slide_layouts[0 ...

  22. PPTX Introduction to Python

    About python. Development started in the 1980's by Guido van Rossum. Only became popular in the last 25 years or so. Python is a general-purpose language. Interpreted, very-high-level programming language. Considered to be higher level than C++ or Java. Supports a multitude of programming paradigms. OOP, functional, procedural, logic ...

  23. EECS 201

    layout: true <div class=bot-bar> Python </div> --- class: center, middle # Python #### `import tensorflow as tf` --- # Overview * High level scripting * What is ...

  24. Beginners to Python Programming

    An Introduction to Python Lesson Two. This is the 2nd lesson in a series of 7 one-hour lessons, with full class presentation, lesson plan, and with fully tested codes for any teacher who has little experience of coding, or wants to jump straight in. Easy to follow programming, with all codes supplied and tailor-made videos, to make teaching Python programming effortless.

  25. python-pptx

    python-pptx¶. Release v1.0.0 (Installation)python-pptx is a Python library for creating, reading, and updating PowerPoint (.pptx) files.. A typical use would be generating a PowerPoint presentation from dynamic content such as a database query, analytics output, or a JSON payload, perhaps in response to an HTTP request and downloading the generated PPTX file in response.