def startViewer(filename):
 if filename:
  try:
   os.startfile(filename)
  except:
   os.system(('open "%s"' % filename))

def startViewer ( filename ) : if filename : try : os . startfile ( filename ) except : os . system ( ( 'open "%s"' % filename ) )
helper for opening a pdf file .