mode = None list = [] x = y = w = h = 0 name = None def flush(): global x, y, w, h, name if mode == 'rect': list.append((x,y,w,h,'box',name)) if mode == 'circle': x = cx - rx y = cy - ry w = rx * 2 h = ry * 2 list.append((x,y,w,h,'circle',name)) x = y = w = h = 0 name = None for line in open("tools/boxes.svg").readlines(): line = line.strip() if line == "') # print('
') # print('') for (x,y,w,h,c,name) in list: x = round(x) y = round(y) w = round(w) h = round(h) print(f'
{name}
') # print('
') #print_html() print_list2()