Skip to content

Instantly share code, notes, and snippets.

View mvoong's full-sized avatar

Michael Voong mvoong

  • London, United Kingdom
View GitHub Profile
@mvoong
mvoong / resources.py
Last active May 4, 2019 14:16
Android namespace declaration in lxml
import lxml.etree as etree
tools_ns = "http://schemas.android.com/tools"
root = etree.Element("resources", nsmap={"tools": tools_ns})
root.attrib['{%s}ignore' % tools_ns] = 'MissingTranslation'
print(etree.tostring(root, encoding="unicode", pretty_print=True))