Explorar el Código

删除 'word2pptx.py'

nonvioce hace 6 meses
padre
commit
aa6cff7194
Se han modificado 1 ficheros con 0 adiciones y 29 borrados
  1. 0 29
      word2pptx.py

+ 0 - 29
word2pptx.py

@@ -1,29 +0,0 @@
-import os
-from docx import Document
-from PIL import ImageGrab
-
-def save_images(doc, folder_path):
-   if not os.path.exists(folder_path):
-       os.makedirs(folder_path)
-
-   for index, paragraph in enumerate(doc.paragraphs):
-       if paragraph.style.name.startswith('Heading'):
-           question = paragraph.text
-           answer = doc.paragraphs[index + 1].text
-           save_image(question, answer, folder_path)
-
-
-
-def save_image(question, answer, folder_path):
-   image_name = f"{question.replace(' ', '-')}.png"
-   image_path = os.path.join(folder_path, image_name)
-   print(f"Saving image {image_name}...")
-   image = ImageGrab.grab(question)
-   image.save(image_path)
-
-if __name__ == "__main__":
-   word_file = "test.docx"
-   folder_path = "images"
-
-   doc = Document(word_file)
-   save_images(doc, folder_path)