def xstrip(filename):
 while xisabs(filename):
  if re.match('\\w:[\\\\/]', filename):
   filename = re.sub('^\\w+:[\\\\/]+', '', filename)
  elif re.match('[\\\\/]', filename):
   filename = re.sub('^[\\\\/]+', '', filename)
 return filename

def xstrip ( filename ) : while xisabs ( filename ) : if re . match ( '\\w:[\\\\/]' , filename ) : filename = re . sub ( '^\\w+:[\\\\/]+' , '' , filename ) elif re . match ( '[\\\\/]' , filename ) : filename = re . sub ( '^[\\\\/]+' , '' , filename ) return filename
make relative path out of absolute by stripping prefixes used on linux .