如何根据deepseek的提纲自动生成ppt - split('
要根据deepseek的提纲自动生成ppt,你可以使用以下步骤:
打开你的文本编辑器(如notepad++、sublime text等),将deepseek的提纲复制粘贴到编辑器中。
在编辑器中,根据提纲的内容,逐条列出每个要点,并添加相应的图片、图表、数据等元素。确保每个要点都有清晰的标题和描述。
使用markdown语法编写代码,将提纲转换为ppt文件。例如:
# -*- coding: utf-8 -*-
import os
import re
from pptx import Presentation
def generate_ppt(out_path, in_path):
with open(in_path, 'r', encoding='utf-8') as f:
content = f.read()
doc = Presentation()
doc.slide_layouts[0].custom_text_frame.text = content
slide_num = 1
for line in content.split('\n'):
line = line.strip()
if not line or line.startswith('#'):
continue
if line.startswith('#'):
doc.slide_layouts[0].custom_text_frame.text = ''
slide_num += 1
doc.slide_layouts[0].custom_text_frame.text = f'第{slide_num}页' 拼多多帮助力入口
break
else:
doc.slide_layouts[0].custom_text_frame.text = line
doc.save(out_path)
if __name__ == '__main__':
out_path = 'output.pptx'
in_path = 'input.md'
generate_ppt(out_path, in_path)
运行上述代码,生成的ppt文件将保存在指定的路径下。
根据需要对生成的ppt进行编辑和美化,使其更符合deepseek的提纲要求。