def rootname(filename):
 if (os.path.sep not in filename):
  return ''
 else:
  (file_root, _) = filename.split(os.path.sep, 1)
  return file_root

def rootname ( filename ) : if ( os . path . sep not in filename ) : return '' else : ( file_root , _ ) = filename . split ( os . path . sep , 1 ) return file_root
get the root directory that a file is contained in .