python launch file

Solutions on MaxInterview for python launch file by the best coders in the world

showing results for - "python launch file"
Ivanna
29 May 2016
1#how to open file with the default application for that file set by the OS
2
3import os
4
5filename = "PATH_TO_FILE" # EG. "C:\Users\baguette\Downloads\image.png"
6
7os.system("open " + shlex.quote(filename)) #MacOS/X
8os.system("start " + filename) #windows
9
10#Information and more available at 
11#https://stackoverflow.com/questions/434597/open-document-with-default-os-application-in-python-both-in-windows-and-mac-os