list = [] def flush(): global mode, name, x, y, w, h if mode == 'rect': list.append((name, round(x+w/2), round(y+h/2))) if mode == 'circle': list.append((name, round(x), round(y))) mode = None def readsvg(filename): global mode, name, x, y, w, h mode = None name = None x = y = w = h = 0 for line in open(filename).readlines(): line = line.strip() if line == "