import re
from collections import defaultdict

...

Python On Count word occurrences in a...

by Tim, June 29, 2008 00:32 Star_fullStar_fullStar_full
D41d8cd98f00b204e9800998ecf8427e Talk

Python On Django / Python / Paginatio...

by Michael, June 26, 2008 20:08

I've written a digg-like pa...

Ae6e94b88e9fce8c14d63640aad14946 Talk
import random

numbers = input("Numbers to generate: ")
...

Python On Random number generator

by yoness, May 30, 2008 13:23 Star_fullStar_fullStar_fullStar_fullStar_full

You can modify radically th...

8c44876dda4cdf65331f082686103ad2 Talk
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 ...

3b6399959bbfd36f5aba155ef0c6e133 Talk
from random import random
print reduce(lambda x,y: x + x * random(), [2] + [0] * 24)

Python On Random number generator

by JL, May 23, 2008 18:48

I also can't see the point....

D41d8cd98f00b204e9800998ecf8427e Talk

Python On Random number generator

by Simon Law, April 18, 2008 13:31

I see what you're doing her...

6869f98aa6911b0f9f13468ccca24813 Talk
import time
import os
import sys
...

Python On sendfile.SftpSClient

by Simon Law, March 20, 2008 00:02

You use pycurl outside of i...

6869f98aa6911b0f9f13468ccca24813 Talk

Python On sendfile.SftpSClient

by dhylton.myopenid.com, March 19, 2008 17:13

why does this not apply to ...

03402885f5a969d18fa2ac4b56348196 Talk

Python On sendfile.SftpSClient

by Simon Law, March 19, 2008 17:06

That's because pycurl is on...

6869f98aa6911b0f9f13468ccca24813 Talk
def add(a, b):
    return a + b

...

Python On Currying decorator

by brent, March 05, 2008 18:31
673a112cceaf8a4714ac6c3b6ae91690 Talk
// 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 Star_full

This is the best solution I...

762e6a51b13c6357f178e65b19392e09 Talk
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...

9c52ad00ba2f2602661c49f896733229 Talk

Python On .ini file parser

by lbolognini, January 09, 2008 09:20

Thanks John!

D2ff155cd04fa175620d2f3495b11b08 Talk
import sys
import re

...

Python On .ini file parser

by John, January 09, 2008 06:04
D41d8cd98f00b204e9800998ecf8427e Talk

Python On Custom sort a list of words

by jaredgrubb, December 14, 2007 21:57

(ugh, my ancient BASIC back...

848e7681373328946b4b7ccb3a537627 Talk
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...

848e7681373328946b4b7ccb3a537627 Talk

Python On Custom sort a list of words

by armandino.myopenid.com, December 12, 2007 03:00

Hi Jared,

There seems to b...

2155c92be66863c4634778bf522efe14 Talk
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...

848e7681373328946b4b7ccb3a537627 Talk
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 Star_fullStar_fullStar_fullStar_full

adict.update() overwrites t...

D2ff155cd04fa175620d2f3495b11b08 Talk
import re

def getWordFrequencies(text):
...

Python On Count word occurrences in a...

by Elij, December 08, 2007 08:58 Star_fullStar_fullStar_fullStar_full

The regex needs some work -...

4d72203c38dd5f3e3d2d446b5888e8a7 Talk

Python On .ini file parser

by jaredgrubb, November 17, 2007 18:34

If what you're looking for ...

848e7681373328946b4b7ccb3a537627 Talk
#! /usr/bin/python
""" A python primer. pydoc, doctest and classes.

...

Python On Classtemplate

by gioby, November 15, 2007 23:19

This template is a very nic...

B4e2590d3e9900d359fdfcc96cbb040b Talk

Python On .ini file parser

by lbolognini, November 13, 2007 09:18

Hi Jared,

that solution wo...

D2ff155cd04fa175620d2f3495b11b08 Talk

Python On .ini file parser

by jaredgrubb, November 11, 2007 20:50

I know this may not be the ...

848e7681373328946b4b7ccb3a537627 Talk
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...

D41d8cd98f00b204e9800998ecf8427e Talk