Skip to content

Commit 40c7104

Browse files
committed
Flake8
1 parent 4b7f2a5 commit 40c7104

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

ppt2video/convertor.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import win32com.client
22
import os
33
import sys
4-
from more_itertools import value_chain
54

65
# PpSaveAsFileType enumeration (PowerPoint)
76
ppSaveAsMP4 = 39
@@ -18,7 +17,7 @@ def ppt2video(pptx, video, timing, duration,
1817
if sys.platform == "win32":
1918
pass
2019
else:
21-
print ("Sorry, this script can be run only on Windows.")
20+
print("Sorry, this script can be run only on Windows.")
2221

2322
# Create files pathes for the ppt and video files.
2423
ppt_path = os.path.abspath(pptx)
@@ -63,7 +62,7 @@ def ppt2video(pptx, video, timing, duration,
6362
# Presentation.CreateVideo method (PowerPoint)
6463
# https://docs.microsoft.com/en-us/office/vba/api/powerpoint.presentation.createvideo
6564
new_presentation.CreateVideo(video_path, timing, duration,
66-
resolution, frames, quality)
65+
resolution, frames, quality)
6766
while True:
6867
try:
6968
# Update the video file, if already exists.
@@ -79,8 +78,10 @@ def ppt2video(pptx, video, timing, duration,
7978

8079

8180
if __name__ == '__main__':
82-
file_name = "presentation.pptx" # e.g.:test.pptx, file expected to be in the root folder
83-
video_name = "presentation_video" # e.g.: test_video, will be created in the root folder
81+
# e.g.:test.pptx, file expected to be in the root folder
82+
file_name = "presentation.pptx"
83+
# e.g.: test_video, will be created in the root folder
84+
video_name = "video"
8485
UseTimingsAndNarrations = False # Boolean value
8586
DefaultSlideDuration = 2 # Int
8687
VertResolution = 720 # Int
@@ -95,9 +96,7 @@ def ppt2video(pptx, video, timing, duration,
9596
# "4":"input before slide number 4, the forth slide"}
9697
# You can choose to what slides to add precending text and what slides
9798
# to leave without additional input.
98-
input_dict = { "1":"input index 1",
99-
"2":"input index 2", "4":"input index 4", "5":"input index 5",
100-
"10":"input index 10"}
99+
input_dict = {}
101100

102101
ppt2video(f"./{file_name}", f"./{video_name}.mp4",
103102
UseTimingsAndNarrations,

ppt2video/presentation_video.mp4

-1.42 MB
Binary file not shown.

0 commit comments

Comments
 (0)