Johnseito
Johnseito

Reputation: 315

Opening existing PowerPoint from a directory with Python 3.5

Open an existing PowerPoint Presentation from a directory Example from here: Charts from Excel to PowerPoint with Python

My situation is different - the link showed how to to open a new presentation not a saved existing one.

error message:

module None.

Upvotes: 1

Views: 2201

Answers (1)

user2722968
user2722968

Reputation: 16535

You can call out to the open cmd and pass the filename to be opened as the only parameter. It will query the registry to find the program that should be used as default to open such a file, how to do it, and then do it.

This should work, did not check though

subprocess.run(['open', 'the file to be opened.pptx'])

Update: There is also https://docs.python.org/3/library/os.html#os.startfile

Upvotes: 1

Related Questions