Loading...
「ツール」は右上に移動しました。
利用したサーバー: natural-voltaic-titanium
1いいね 149回再生

How To Create PowerPoint Presentations With Python From Command Line

Automating the Process of Creating Simple PowerPoint Slides with Python-pptx Library.



Link:
Code - mega.nz/file/LFcyWRhB#NiVYpOyGZhT2V5J8JwpmJCUGbMqA…



Commands:
sudo apt install python3
sudo dnf install python3
pip install python-pptx
nano create_ppt.py
python3 create_ppt.py



Code:
from pptx import Presentation
from pptx.util import Inches

Create a new presentation object
presentation = Presentation()

Title Slide
title_slide_layout = presentation.slide_layouts[0] # Layout for title slides
slide = presentation.slides.add_slide(title_slide_layout)
title = slide.shapes.title
subtitle = slide.placeholders[1]
title.text = "Linux Security Automation"
subtitle.text = "An overview of securing Linux systems"

Slide 1: Importance of Linux Security
content_slide_layout = presentation.slide_layouts[1] # Layout for content slides
slide = presentation.slides.add_slide(content_slide_layout)
title = slide.shapes.title
content = slide.placeholders[1]
title.text = "Importance of Linux Security"
content.text = (
"1. Protects against unauthorized access.\n"
"2. Ensures data integrity.\n"
"3. Maintains system availability.\n"
"4. Protects sensitive information.\n"
)

Slide 2: Common Security Practices
slide = presentation.slides.add_slide(content_slide_layout)
title = slide.shapes.title
content = slide.placeholders[1]
title.text = "Common Security Practices"
content.text = (
"1. Regularly update and patch the system.\n"
"2. Use strong passwords and change them regularly.\n"
"3. Enable and configure firewalls.\n"
"4. Use antivirus software.\n"
"5. Monitor system logs for suspicious activities.\n"
)

Slide 3: Security Tools
slide = presentation.slides.add_slide(content_slide_layout)
title = slide.shapes.title
content = slide.placeholders[1]
title.text = "Security Tools"
content.text = (
"1. SELinux/AppArmor - Mandatory Access Control.\n"
"2. ClamAV - Antivirus software.\n"
"3. Fail2Ban - Prevent brute force attacks.\n"
"4. UFW - Uncomplicated Firewall.\n"
)

Save the presentation
presentation.save('Linux_Security_Presentation.pptx')




Chapters:
0:00 Intro
0:19 Step 1 - Installing Prerequisites
1:00 Step 2 - Creating the Python Script
2:52 Step 3 - Generate PowerPoint Slides
3:56 End screen




What you will learn:
1. How to use Python and the python-pptx library to create PowerPoint presentations from command line
2. Create powerpoint presentations on all major platforms, including Linux, macOS, and Windows
3. How to generate PowerPoint presentations dynamically
4. How to automate the process of creating simple PowerPoint presentations using python-pptx library
5. Create PowerPoint Presentations using Python
6. Step 1 - Installing Prerequisites
a. How to ensure that you have Python installed on your system
b. How to install Python on Debian-based systems and On Red-hat based systems
c. How to install the python-pptx library using pip
d. How to create PowerPoint presentations programmatically
7. Step 2 - Creating the Python Script
a. How to Create a new Python script
b. How to save nano file
8. Step 3 - Generate PowerPoint Slides
a. How to generate a new PowerPoint file


























Song: Konqeson - Bikini
Music provided by Vlog No Copyright Music.
Video Link: bit.ly/3o6vTLZ

#computereverywhere #howtocreate #powerpointpresentations #python #commandline

コメント