Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
#!/bin/bash | |
# | |
# Shell script to automatically configure a new Flask, nginx and uWSGI based blog | |
# on an Amazon EC2 instance. | |
# | |
# See http://bit.ly/MeGwjD for more information! | |
# | |
# If you are forking this for your own custom configuration script, see the following other gists: | |
# https://gist.github.com/3071737 | |
# https://gist.github.com/3071739 |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!