Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python launch file

#how to open file with the default application for that file set by the OS

import os

filename = "PATH_TO_FILE" # EG. "C:UsersaguetteDownloadsimage.png"

os.system("open " + shlex.quote(filename)) #MacOS/X
os.system("start " + filename) #windows

#Information and more available at 
#https://stackoverflow.com/questions/434597/open-document-with-default-os-application-in-python-both-in-windows-and-mac-os
Comment

PREVIOUS NEXT
Code Example
Python :: Codeforce 4C solution in python 
Python :: installing more modules in pypy 
Python :: python pickle example 
Python :: powershell to python converter 
Python :: goal parser 
Python :: pandas column not in list 
Python :: suppress warning jupyter notebook 
Python :: print list vertically in python with loop 
Python :: all possible substring in python 
Python :: discord.py on command error 
Python :: pandas groupby aggregate quantile 
Python :: reverse linked list with python 
Python :: how to add and subtract days datetime python 
Python :: python string remove whitespace and newlines 
Python :: raw string 
Python :: python comprehension with sum 
Python :: how to wait until pressing button in tkinter 
Python :: cmd python -m 
Python :: python in line conditional statement 
Python :: pandas drop rows with empty list 
Python :: how to fix geometry of a window in tkinter 
Python :: numpy multidimensional indexing 
Python :: check dictionary is empty or not in python 
Python :: python loop through array backwards 
Python :: pyqt display math 
Python :: google translate with python 
Python :: ec2 upgrade python 3.7 to 3.8 
Python :: loop through 2 dataframes at once 
Python :: python: check type and ifno of a data frame 
Python :: convert birth date to age pandas 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =