import re from collections import defaultdict ...
Python On Django / Python / Paginatio...
by Michael,
June 26, 2008 20:08
I've written a digg-like pa...
from collections import defaultdict as dd def list_cmp(order): ...
Python On Custom sort a list of words
by Bjoern Brandenburg,
May 24, 2008 01:59
This can be done much more ...
from random import random print reduce(lambda x,y: x + x * random(), [2] + [0] * 24)
Python On sendfile.SftpSClient
by dhylton.myopenid.com,
March 19, 2008 17:13
why does this not apply to ...
// s is the string to check occurances of.
alert(s.split("YourWord").length - 1);
Python On Count word occurrences in a...
by Netferret,
February 25, 2008 15:40
This is the best solution I...
from itertools import izip def alphabet_cmp(a, b): ...
Python On Custom sort a list of words
by orip,
January 18, 2008 01:12
armandino - I liked how you...
Python On Custom sort a list of words
by jaredgrubb,
December 14, 2007 21:57
(ugh, my ancient BASIC back...
if a_i!=b_i then:
return cmp(a_i, b_i)
return my_cmp(a[1:], b[1:])
Python On Custom sort a list of words
by jaredgrubb,
December 14, 2007 21:56
As for the difference betwe...
Python On Custom sort a list of words
by armandino.myopenid.com,
December 12, 2007 03:00
Hi Jared,
There seems to b...
def my_cmp(a, b): global alphabet ...
Python On Custom sort a list of words
by jaredgrubb,
December 11, 2007 04:24
You can use the sort() meth...
mamaMia = "Mamma mia, here I go again\ Mamma mia, here I go again\ My my, how can I resist you?\ ...
Python On Count word occurrences in a...
by lbolognini,
December 08, 2007 14:02
adict.update() overwrites t...
import re def getWordFrequencies(text): ...
Python On Count word occurrences in a...
by Elij,
December 08, 2007 08:58
The regex needs some work -...
#! /usr/bin/python """ A python primer. pydoc, doctest and classes. ...
def pascal(nlines, line=[1]):
yield line
for x in xrange(nlines-1):
...
Python On Pascal's Triangle
by Anders Waldenborg,
October 28, 2007 10:00
Just some minor improvement...
