Opening documents with default applications in OS X using Python

22 Nov 2019

In Chapter 15 of ABS, the author suggests the following for opening documents with a default application in OS using Python:

>>> import subprocess
>>> subprocess.Popen(['start', 'filename'])

In addition to this, I found two alternatives that worked for me on a Stack Overflow post

>>> import subprocess
>>> subprocess.run(['open', 'filename'], check=True)

>>> import os
>>> os.popen('open filename')