claude如何帮你设计高端大气的ppt模板?
网友回复
claude可直接使用python代码帮你生成好看的ppt文件,包括文字和大纲
生成的python ppt代码
from pptx import Presentation from pptx.util import Inches, Pt from pptx.dml.color import RGBColor from pptx.enum.text import PP_ALIGN import os def create_ai_future_ppt(): # 创建演示文稿对象 prs = Presentation() # 设置幻灯片尺寸为宽屏16:9 prs.slide_width = Inches(16) prs.slide_height = Inches(9) # 定义颜色方案 colors = { 'dark_blue': RGBColor(28, 58, 112), 'light_blue': RGBColor(92, 179, 255), 'deep_purple': RGBColor(70, 40, 120), 'accent_purple': RGBColor(149, 117, 205), 'white': RGBColor(255, 255, 255), 'black': RGBColor(0, 0, 0), 'gray': RGBColor(128, 128, 128), 'light_gray': RGBColor(230, 230, 230) } # 创建封面幻灯片 slide_layout = prs.slide_layouts[0] # 使用标题幻灯片布局 slide = prs.slides.add_slide(slide_layout) # 设置背景 background = slide.background fill = background.fill fill.solid() fill.fore_color.rgb = colors['deep_purple'] # 添加标题 title = slide.shapes.title title.text = "AI科技改变未来" title.text_frame.paragraphs[0].alignment = PP_ALIGN.CENTER title.text_frame.paragraphs[0].font.size = Pt(60) title.text_frame.paragraphs[0].font.color.rgb = colors['white'] title.text_frame.paragraphs[0].font.bold = True # 添加副标题 subtitle = slide.placeholders[1] subtitle.text = "探索人工智能如何塑造我们的明天" subtitle.text_frame.paragraphs[0].alignment = PP_ALIGN.CENTER subtitle.text_frame.paragraphs[0].font.size = Pt(32) subtitle.text_frame.paragraphs[0].font.color.rgb = colors['light_blue'] # 目录页 slide_layout = prs.slide_layouts[1] # 使用标题和内容布局 slide = prs.slides.add_slide(slide_layout) # 设置背景 background = slide.background fill = background.fill fill.solid() fill.fore_color.rgb = colors['white'] # 添加标题 title = slide.shapes.title title.text = "目录" title.text_frame.paragraphs[0].alignment = PP_ALIGN.LEFT title.text_frame.paragraphs[0].font.size = Pt(44) title.text_frame.paragraphs[0].font.color.rgb = colors['deep_purple'] title.text_frame.paragraphs[0].font.bold = True # 添加目录内容 content = slide.placeholders[1] tf = content.text_frame p = tf.paragraphs[0] p.text = "1. AI科技概述" p.font.size = Pt(28) p.font.color.rgb = colors['dark_blue'] p = tf.add_paragraph() p.text = "2. AI的发展历程与现状" p.font.size = Pt(28) p.font.color.rgb = colors['dark_blue'] p = tf.add_paragraph() p.text = "3. AI技术的关键应用领域" p.font.size = Pt(28) p.font.color.rgb = colors['dark_blue'] p = tf.add_paragraph() p.text = "4. AI如何改变未来生活" p.font.size = Pt(28) p.font.color.rgb = colors['dark_blue'] p = tf.add_paragraph() p.text = "5. AI发展面临的挑战" p.font.size = Pt(28) p.font.color.rgb = colors['dark_blue'] p = tf.add_paragraph() p.text = "6. 人类与AI共创未来" p.font.size = Pt(28) p.font.color.rgb = colors['dark_blue'] # AI科技概述页 slide_layout = prs.slide_layouts[1] slide = prs.slides.add_slide(slide_layout) # 设置背景 background = slide.background fill = background.fill fill.solid() fill.fore_color.rgb = colors['light_gray'] # 添加标题 title = slide.shapes.title title.text = "1. AI科技概述" title.text_frame.paragraphs[0].alignment = PP_ALIGN.LEFT title.text_frame.paragraphs[0].font.size = Pt(44) title.text_frame.paragraphs[0].font.color.rgb = colors['deep_purple'] title.text_frame.paragraphs[0].font.bold = True # 添加内容 content = slide.placeholders[1] tf = content.text_frame p = tf.paragraphs[0] p.text = "人工智能(AI)是一门让机器模拟人类智能的科学技术" p.font.size = Pt(28) p.font.color.rgb = colors['dark_blue'] p = tf.add_paragraph() p.text = "• 机器学习: 让计算机从数据中学习并优化性能" p.font.size = Pt(28) p.font.color.rgb = colors['dark_blue'] p = tf.add_paragraph() p.text = "• 深度学习: 基于神经网络的复杂模式识别" p.font.size = Pt(28) p.font.color.rgb = colors['dark_blue'] p =...
点击查看剩余70%