From 574118aed0a8a089fa482fa856e79f62d9c6fdd5 Mon Sep 17 00:00:00 2001 From: Jac Date: Tue, 1 Aug 2023 16:29:14 -0700 Subject: [PATCH] add powerpoint example in samples (#1262) --- samples/explore_workbook.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/samples/explore_workbook.py b/samples/explore_workbook.py index c61b9b637..57f88aa07 100644 --- a/samples/explore_workbook.py +++ b/samples/explore_workbook.py @@ -36,6 +36,9 @@ def main(): parser.add_argument( "--preview-image", "-i", metavar="FILENAME", help="filename (a .png file) to save the preview image" ) + parser.add_argument( + "--powerpoint", "-ppt", metavar="FILENAME", help="filename (a .ppt file) to save the powerpoint deck" + ) args = parser.parse_args() @@ -145,6 +148,13 @@ def main(): f.write(c.image) print("saved to " + filename) + if args.powerpoint: + # Populate workbook preview image + server.workbooks.populate_powerpoint(sample_workbook) + with open(args.powerpoint, "wb") as f: + f.write(sample_workbook.powerpoint) + print("\nDownloaded powerpoint of workbook to {}".format(os.path.abspath(args.powerpoint))) + if args.delete: print("deleting {}".format(c.id)) unlucky = TSC.CustomViewItem(c.id)