def default_opener(filename):
 from subprocess import call
 cmds = {'darwin': ['open'], 'linux2': ['xdg-open'], 'win32': ['cmd.exe', '/C', 'start', '']}
 cmd = (cmds[sys.platform] + [filename])
 call(cmd)

def default_opener ( filename ) : from subprocess import call cmds = { 'darwin' : [ 'open' ] , 'linux2' : [ 'xdg-open' ] , 'win32' : [ 'cmd.exe' , '/C' , 'start' , '' ] } cmd = ( cmds [ sys . platform ] + [ filename ] ) call ( cmd )
opens filename using systems default program .