def read_path_from_svg(svg_filename):
# re_split = re.compile('\s+|,')
try:
tree = etree.parse(open(svg_filename))
except (OSError, IOError):
tkMessageBox.showwarning(title = 'Error during reticule import',message = "the file %s was not found" %svg_filename)
path_list = [];
for element in tree.iter():
if element.tag.split("}")[1] == "path":
#re_split.split(element.get("d"))
path_list.append(element.get('d'))
#path_list.append(re_split)
Points = string2points(path_list)
return Points
评论列表
文章目录