import os os.startfile('foo.docx') os.startfile('bad.exe') os.startfile('text.txt')