Skip to content

Instantly share code, notes, and snippets.

@krist10an
krist10an / gist:2ba59737bd4841cbe53f
Last active August 29, 2015 14:05
XML visualization
import xml.etree.ElementTree as etree
import sys
import os.path
def visualize_xml(element, padding=' '):
""" Visualize all ElementTree nodes by printing them to screen """
if type(element.tag) != str:
return