Skip to content

Commit 574118a

Browse files
authored
add powerpoint example in samples (#1262)
1 parent 77f2f63 commit 574118a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

samples/explore_workbook.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ def main():
3636
parser.add_argument(
3737
"--preview-image", "-i", metavar="FILENAME", help="filename (a .png file) to save the preview image"
3838
)
39+
parser.add_argument(
40+
"--powerpoint", "-ppt", metavar="FILENAME", help="filename (a .ppt file) to save the powerpoint deck"
41+
)
3942

4043
args = parser.parse_args()
4144

@@ -145,6 +148,13 @@ def main():
145148
f.write(c.image)
146149
print("saved to " + filename)
147150

151+
if args.powerpoint:
152+
# Populate workbook preview image
153+
server.workbooks.populate_powerpoint(sample_workbook)
154+
with open(args.powerpoint, "wb") as f:
155+
f.write(sample_workbook.powerpoint)
156+
print("\nDownloaded powerpoint of workbook to {}".format(os.path.abspath(args.powerpoint)))
157+
148158
if args.delete:
149159
print("deleting {}".format(c.id))
150160
unlucky = TSC.CustomViewItem(c.id)

0 commit comments

Comments
 (0)