Skip to content

Commit

Permalink
add powerpoint example in samples (#1262)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacalata authored Aug 1, 2023
1 parent 77f2f63 commit 574118a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions samples/explore_workbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 574118a

Please sign in to comment.