Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Controlling Powerpoint using Leap motion and Python

I just started up with python.I lately got a project where I have to make a powerpoint slideshow.This has to be done using leap motion sdk and python.So my powerpoint will be gesture based.

  1. How do I deploy this on my desktop in such a away that I just need to click on my desktop app or the ppt file itself, I get started with the powerpoint like on windows.
  2. I need to detect the finger gestures using python and integrate it to next - previous functionality.

Can I get some guidance on powerpoint with PPT?

I have got the API,Documentation,SDK and I am learning python too.

like image 952
HIRA THAKUR Avatar asked Aug 26 '26 21:08

HIRA THAKUR


1 Answers

The pywin32 library has a win32com.client module that lets you use COM API to control PowerPoint.

For example, this code will add a slide with an oval in it:

import win32com.client

Application = win32com.client.Dispatch("PowerPoint.Application")
Presentation = Application.Presentations.Add()
Base = Presentation.Slides.Add(1, 12)
oval = Base.Shapes.AddShape(9, 100, 100, 100, 100)

This IPython notebook has step-by-step examples on how to create a PowerPoint presentation, add objects to it, and make those objects interact in PowerPoint.

While this will allow you to use PowerPoint as an output interface, you need a different mechanism for sending messages back from PowerPoint to Python. One way is to set up a Macro that runs on a click event that interacts with a COM server set up in Python.

like image 178
S Anand Avatar answered Aug 29 '26 11:08

S Anand



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!