Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| #!/bin/bash | |
| ############################################### | |
| # To use: | |
| # https://raw.github.com/gist/2776351/??? | |
| # chmod 777 install_postgresql.sh | |
| # ./install_postgresql.sh | |
| ############################################### | |
| echo "*****************************************" | |
| echo " Installing PostgreSQL" | |
| echo "*****************************************" |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!