Auto-generate a polished 22-slide PowerPoint presentation on Page Replacement Algorithms (LRU, Clock, LFU) using python-pptx. Designed for university OS course presentations.
- 22 fully populated slides with theory, simulation traces, pros/cons, and comparison
- Dynamic simulation — LRU, Clock, and LFU algorithms run on a configurable reference string
- Styled trace tables — alternating rows, color-coded fault/hit cells
- Professional design — 16:9 widescreen, navy title bar, shadow cards, accent colors
- OS implementation details — real-world Linux, FreeBSD, Windows, Redis examples
- No external dependencies beyond
python-pptx— all visuals built with shapes and fills
| Slides | Section |
|---|---|
| 1–2 | Title & Agenda |
| 3–6 | Introduction & Motivation |
| 7–10 | LRU Algorithm (Theory, How It Works, Simulation, Pros & Cons) |
| 11–14 | Clock Algorithm (Theory, How It Works, Simulation, Pros & Cons) |
| 15–18 | LFU Algorithm (Theory, How It Works, Simulation, Pros & Cons) |
| 19–20 | Comparison & Summary |
| 21–22 | References & Questions |
- Python 3.8+
python-pptx
pip install python-pptxpython generate_ppt.pyOutput: Page_Replacement_Algorithms.pptx in the same directory.
Edit the top of generate_ppt.py to customize:
REF_STRING = [7, 0, 1, 2, 0, 3, 0, 4, 2, 3] # Page reference string
NUM_FRAMES = 3 # Number of physical frames| Element | Hex | Usage |
|---|---|---|
| Navy | #1B2A4A |
Title bar |
| Primary Blue | #2E86C1 |
LRU theme, accents |
| Teal | #1ABC9C |
Clock theme |
| Purple | #8E44AD |
LFU theme |
| Amber | #F39C12 |
Highlights |
| Green | #27AE60 |
Advantages |
| Red | #E74C3C |
Disadvantages |
Place a logo.png in the same directory as the script. It will automatically appear in the top-right corner of every slide. If no logo is found, a placeholder rectangle is used.
The generated presentation includes:
- Geometric accent shapes on title/closing slides
- Horizontal card-based agenda with color progression
- Two-column green/red pros & cons cards with accent bars
- Comparison table with colored dots (🟢🟡🔴) and algorithm-themed headers
- Full-width example footer strips with contextual tips
MIT