def xisabs(filename):
 if filename.startswith('/'):
  return True
 elif filename.startswith('\\'):
  return True
 elif re.match('\\w:[\\\\/]', filename):
  return True
 return False

def xisabs ( filename ) : if filename . startswith ( '/' ) : return True elif filename . startswith ( '\\' ) : return True elif re . match ( '\\w:[\\\\/]' , filename ) : return True return False
cross-platform version of os .