Skip to content

Instantly share code, notes, and snippets.

View peterkellydev's full-sized avatar

Peter Kelly peterkellydev

  • Tigera
  • Ireland
View GitHub Profile
@florentx
florentx / pep8xml.py
Last active June 6, 2018 05:43
XML output format for pep8
#!python
import pep8
from xml.etree import ElementTree as ET
def prettyindent(elem, level=0):
# Adapted from http://effbot.org/zone/element-lib.htm#prettyprint
ind = "\n" + level * " "
if level:
elem.tail = ind