Skip to content

Instantly share code, notes, and snippets.

@mariopesch
Last active September 9, 2020 12:38
Show Gist options
  • Save mariopesch/de992c4d38c072ee74526685e3b649d1 to your computer and use it in GitHub Desktop.
Save mariopesch/de992c4d38c072ee74526685e3b649d1 to your computer and use it in GitHub Desktop.
from xml.dom import minidom
import collections
xmldoc = minidom.parse('Sketch_Name.xml')
itemlist = xmldoc.getElementsByTagName('block')
print(len(itemlist))
blocks = []
#print(itemlist[0].attributes['type'].value)
for s in itemlist:
print(s.attributes['type'].value)
blocks.append(s.attributes['type'].value)
print(collections.Counter(blocks).most_common())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment