Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
""" | |
from __future__ import print_function | |
import sys | |
import os |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# vim: fileencoding=utf-8 | |
""" | |
Search Mac Address Book contacts via official API | |
""" | |
from __future__ import print_function, unicode_literals | |
import sys | |
from time import time |
#!/usr/bin/env python | |
# encoding: utf-8 | |
# | |
# Copyright © 2014 deanishe@deanishe.net | |
# | |
# MIT Licence. See http://opensource.org/licenses/MIT | |
# | |
# Created on 2014-03-03 | |
# |
#!/usr/bin/env python | |
# encoding: utf-8 | |
# | |
# Copyright © 2014 deanishe@deanishe.net | |
# | |
# MIT Licence. See http://opensource.org/licenses/MIT | |
# | |
# Created on 2014-03-08 | |
# |
#!/usr/bin/env python | |
# encoding: utf-8 | |
# | |
# Copyright © 2014 deanishe@deanishe.net | |
# | |
# MIT Licence. See http://opensource.org/licenses/MIT | |
# | |
# Created on 2014-04-02 | |
# |
sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7 | |
sudo rm -rf "/Applications/Python 2.7" | |
cd /usr/local/bin | |
ls -l . | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | xargs rm |
# The following functions append/prepend the specified directory to the path variable specified by name | |
# If the directory is already in the path, it is first removed and then appended/prepended. | |
# Examples: | |
# | |
# Prepend `~/bin` to `$PATH`: | |
# prepend_path PATH ~/bin | |
# | |
# Append `~bin` to `$PATH` instead: | |
# append_path PATH ~/bin | |
# (this will remove `~/bin` from the beginning of `$PATH` first) |
#!/usr/bin/python | |
# encoding: utf-8 | |
# | |
# Copyright (c) 2013 <deanishe@deanishe.net>. | |
# | |
# MIT Licence. See http://opensource.org/licenses/MIT | |
# | |
# Created on 2013-11-01 | |
# |
#!/usr/bin/python | |
# encoding: utf-8 | |
# | |
# Copyright (c) 2013 deanishe@deanishe.net. | |
# | |
# MIT Licence. See http://opensource.org/licenses/MIT | |
# | |
# Created on 2013-11-01 | |
# |