def openExplorer(filename):
 if ((sys.platform == 'win32') or (sys.platform == 'cygwin')):
  subprocess.Popen(('explorer /select,"%s"' % filename))
 if (sys.platform == 'darwin'):
  subprocess.Popen(['open', '-R', filename])
 if sys.platform.startswith('linux'):
  if os.path.isfile('/usr/bin/xdg-open'):
   subprocess.Popen(['/usr/bin/xdg-open', os.path.split(filename)[0]])

def openExplorer ( filename ) : if ( ( sys . platform == 'win32' ) or ( sys . platform == 'cygwin' ) ) : subprocess . Popen ( ( 'explorer /select,"%s"' % filename ) ) if ( sys . platform == 'darwin' ) : subprocess . Popen ( [ 'open' , '-R' , filename ] ) if sys . platform . startswith ( 'linux' ) : if os . path . isfile ( '/usr/bin/xdg-open' ) : subprocess . Popen ( [ '/usr/bin/xdg-open' , os . path . split ( filename ) [ 0 ] ] )
open an file dialog window in the directory of a file .