Loading ...
Sorry, an error occurred while loading the content.

66296Parsing SVG in python

Expand Messages
  • Pranav Lal
    Jan 13, 2014
    • 0 Attachment
      Hi all,

      Is it possible to parse SVG in python? I was trying to use the following
      code and not getting any output.

      import xml.etree.cElementTree as ET
      except ImportError:
      import xml.etree.ElementTree as ET

      tree = ET.ElementTree(file='plan.svg')

      for elem in tree.iter(tag='rect'):
      print elem.tag, elem.attrib

      The plan.svg file is at:

      I have tried the above code with regular xml and the code works.
    • Show all 3 messages in this topic