def splitPath(path, sep='/'):
 sepIdx = path.find(sep)
 if (sepIdx < 0):
  return (path, None)
 return (path[:sepIdx], path[(sepIdx + 1):])

def splitPath ( path , sep = '/' ) : sepIdx = path . find ( sep ) if ( sepIdx < 0 ) : return ( path , None ) return ( path [ : sepIdx ] , path [ ( sepIdx + 1 ) : ] )
chops the first part of a /-separated path and returns a tuple of the first part and the tail .