svg_toolbox.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:Tweezer_design 作者: AntoineRiaud 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号