Skip to content

Instantly share code, notes, and snippets.

@rik0
rik0 / badmo.py
Created April 20, 2011 16:03 — forked from rubik/badmo.py
import re
import os
import ast
import glob
import collections
class ImportVisitor(ast.NodeVisitor):
def __init__(self):
self.imports = []
self.modules = collections.defaultdict(list)
@rik0
rik0 / test_graph.py
Created April 21, 2012 18:05 — forked from anonymous/test_graph.py
Simple test for a Graph class
import unittest
from graph import Graph
class TestGraph(unittest.TestCase):
def test_init(self):
@rik0
rik0 / subplot_weekdata.py
Created April 24, 2012 12:20 — forked from zarch/subplot_weekdata.py
Plot week data as subplots
# -*- coding: utf-8 -*-
"""
____________________________________________________________
| +--------------------------------------------------------+ |
| ! ^ ___ --- ! |
| ! / \ _--_ / \ /\ / \ ! |
| ! / \__/ \ / \_-___-- \ / \ ! |
| ! / \___/ --__/ --__- ! |
| +-------+-------+-------+-------+-------+-------+--------+ |
| 04/02 04/03 04/04 04/02 04/03 04/04 04/04 |
import objc
import AddressBook as ab
import pprint as pp
def pythonize(objc_obj):
if isinstance(objc_obj, objc.pyobjc_unicode):
return unicode(objc_obj)
elif isinstance(objc_obj, ab.NSDate):
return objc_obj.description()