White scenery @showyou, hatena

If you have any comments, you may also send twitter @shsub or @showyou.

Entries from 2009-06-17 to 1 day

nose

下の続き。doctestじゃなくてunittestで書く。 ここではunittestの補助にnoseを使う。ubuntu 9.04にはnoseがaptで入れられるっぽいのでaptitude install python-noseとかやって入れる。 test_compare.py def test_compare(): assert 1==1 if __name__ == '__…

heapqとdoctest

昨日話を聞いたのでちょっと試してみた。http://www.python.jp/doc/release/lib/module-heapq.htmlこの辺参考に。 >>> from heapq import heappush, heappop >>> heap = [] >>> data = [8, 3, 5, 9, 7, 1, 4] >>> for item in data: ... heappush(heap,item)…