Last active
September 24, 2015 03:56
-
-
Save AaronPhalen/609d24c453e8b08f561a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Aaron Phalen | Twitter: @aaron_phalen | Email: [email protected] | |
# Builder Design Pattern In Python | |
# Creating xml without builder as constract to example | |
from lxml import etree | |
root = etree.Element("root") | |
child = etree.Element("child") | |
child.text = "sample text" | |
root.append(child) | |
# Creating xml with builder to highlight elegance | |
from lxml.builder import E | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment