def fullsplit(path, result=None):
 if (result is None):
  result = []
 (head, tail) = os.path.split(path)
 if (head == ''):
  return ([tail] + result)
 if (head == path):
  return result
 return fullsplit(head, ([tail] + result))

def fullsplit ( path , result = None ) : if ( result is None ) : result = [ ] ( head , tail ) = os . path . split ( path ) if ( head == '' ) : return ( [ tail ] + result ) if ( head == path ) : return result return fullsplit ( head , ( [ tail ] + result ) )
split a pathname into components in a platform-neutral way .