Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html> | |
| <head> | |
| <meta content='text/html, charset=UTF-8' http-equiv='Content-Type' /> | |
| <meta content='IE=7,IE=8,IE=9' http-equiv='X-UA-Compatible' /> | |
| <meta content='initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport' /> | |
| <style type="text/css"> | |
| @import url("http://code.leafletjs.com/leaflet-0.3.1/leaflet.css"); | |
| html, body, div, span, applet, object, iframe, | |
| h1, h2, h3, h4, h5, h6, p, blockquote, pre, |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| DO WTF YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 Alexey Silin <pinkoblomingo@gmail.com> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WTF YOU WANT TO PUBLIC LICENSE |
| #!/usr/bin/env python | |
| # | |
| # Vkontatke OAuth 2.0 wrapper | |
| # Copyright 2011, Adil Khashtamov [adil.khashtamov@gmail.com] | |
| # http://khashtamov.kz | |
| # | |
| # | |
| import logging |