def convert_to_relative(basePath, fileName):
 if fileName.startswith(basePath):
  fileName = fileName.replace(basePath, u'')
  if fileName.startswith(os.path.sep):
   fileName = fileName[1:]
 return fileName

def convert_to_relative ( basePath , fileName ) : if fileName . startswith ( basePath ) : fileName = fileName . replace ( basePath , u'' ) if fileName . startswith ( os . path . sep ) : fileName = fileName [ 1 : ] return fileName
convert a absolut path to relative based on its start with basepath .