1
2
3
4
def perm(ni):
    result = []
    
...

Python Permutation of values

by Auron, October 07, 2008 12:18, 3 refactorings, tagged with recursion, lists

Boys and girls, it's time t...

C2953d47b6de83f3217b48c3584fab1c Talk
1
2
3
4
#!/usr/bin/python

import socket,time
...

Python Connection Detection script

by matthew.scouten.myopenid.com, October 02, 2008 01:06, 1 refactoring, tagged with short python sockets

This is a Quick and Dirty s...

Avatar Talk
1
2
3
4
class Planet(object):
	all = []
	@classmethod
...

Python Pythonify my code

by knutimus.myopenid.com, September 03, 2008 14:27, 3 refactorings, tagged with planet

The get method just doesn't...

Avatar Talk
1
2
3
4
try:
    if options.input_file:
        infile = open(options.input_file, 'r')
...

Python Your average file filter...

by agnul, August 27, 2008 17:22, 4 refactorings

From the useless speculatio...

Ee62f45441fbf8409dfd4adaa40a74aa Talk
1
2
3
4
#!/usr/bin/python
# -*- coding: utf-8 -*-

...

Python Parse XML from Yahoo weathe...

by kael, August 26, 2008 17:27, 1 refactoring, tagged with python, dom, xml, rss

Is there a more efficient w...

Ec5a58db4acc016568e0293d283cbc2d Talk
1
2
3
4
#!/usr/bin/python
# -*- coding: utf-8 -*-

...

Python Base64 image encoding and i...

by kael, August 25, 2008 19:05, 1 refactoring, tagged with python, image, base64, hash, sha224

Is this a correct a way to ...

Ec5a58db4acc016568e0293d283cbc2d Talk
1
2
3
4
#!/usr/bin/python
# -*- coding: utf-8 -*-

...

Python Query TinyUrl the fastest way

by kael, August 25, 2008 18:44, No refactoring, tagged with python, http, tinyurl, urllib, urllib2

I'm looking for the fastest...

Ec5a58db4acc016568e0293d283cbc2d Talk
1
2
3
4
#!/usr/bin/env python
# -*- coding: utf-8 -*-

...

Python Get function's attributes

by ielectric.myopenid.com, August 19, 2008 18:04, 1 refactoring, tagged with function, attribute

I bet there is some other, ...

64798a399a79ed8d34fa83ba0e61c1ac Talk
1
2
3
4
import threading
import time

...

Python RepeatTimer

by roxority, August 09, 2008 19:21, No refactoring

An instance of this class a...

E8684fc4509c4814afdd576f886c2b24 Talk
1
2
3
4
import wsgiref.handlers

from google.appengine.ext import webapp
...

Python Get request path using Goog...

by Zote, July 14, 2008 18:34, 1 refactoring, tagged with python, google application engine, gae, request path

if my url is http://zote.ap...

3079a42933388fed686653b9cd9affba Talk
1
2
3
4
# -*- coding: utf-8 -*-
'''
Description: Blowfish with custom base64 obfuscation. 
...

Python Custom blowfish IRC impleme...

by ielectric.myopenid.com, July 01, 2008 15:27, No refactoring, tagged with blowfish, base64, irc
64798a399a79ed8d34fa83ba0e61c1ac Talk
1
2
3
4
cards = Card.objects.all()

for card in cards:
...

Python Condense my search / replac...

by clickpass.com/public/bosko, June 12, 2008 02:29, 3 refactorings

Code is self explanatory. C...

Avatar Talk
1
2
3
4
def segment_pages(page):
    page.paginator.left = []
    page.paginator.right = []
...

Python Django / Python / Paginatio...

by bramston, June 11, 2008 04:58, 1 refactoring, tagged with django, python, pagination

Really quickly ported some ...

Eb74aac8da41a993ae9dd91a5b13b78a Talk
1
2
3
4
from random import random as _
eval(compile("\n".join(
	["(lambda %s:" % (chr((121 - ((25 - (ord("z") - y)))))) 
...

Python Random number generator

by dbr, April 02, 2008 10:11, 3 refactorings, tagged with random, number

It works okay, but I think ...

Efdad317c297a2aee89ef435995dbdb6 Talk
1
2
3
4
#!/usr/bin/env python
# #########################
# # $Id: sendfile.py,v 1.4 2008/03/19 11:59:52 dhylton Exp $
...

Python sendfile.SftpSClient

by dhylton.myopenid.com, March 19, 2008 14:53, 3 refactorings

the goal is to be able to e...

03402885f5a969d18fa2ac4b56348196 Talk
1
2
3
4

def sort(words):
...

Python Custom sort a list of words

by armandino.myopenid.com, December 10, 2007 02:36, 7 refactorings, tagged with python, sort

My second python script. :)...

2155c92be66863c4634778bf522efe14 Talk
1
2
3
4
import re

def addWord(token, frequencies):
...

Python Count word occurrences in a...

by armandino.myopenid.com, December 08, 2007 07:03, 6 refactorings, tagged with python

This code counts number of ...

2155c92be66863c4634778bf522efe14 Talk
1
2
3
4
class SearchLet(Form):
    district = Field(widget=SelectMultiple(choices=DISTRICTS, required=False)
...

Python Django models search

by lbolognini, November 10, 2007 16:30, 1 refactoring, tagged with python, django, search, orm

I'm using the following cod...

D2ff155cd04fa175620d2f3495b11b08 Talk
1
2
3
import sys
...

Python .ini file parser

by lbolognini, November 08, 2007 21:47, 5 refactorings, tagged with parser, ini

This is an excercise to imp...

D2ff155cd04fa175620d2f3495b11b08 Talk
1
2
3
4
import inspect
def curried(f):
    def curhelp(n, args):
...

Python Currying decorator

by openid.aol.com/Sxipestro, November 01, 2007 21:35, 1 refactoring

This decorator works, but u...

Avatar Talk
1
2
3
4
def summe(zahlMaximum):
	
	z = [0,0,0,0,0,0]
...

Python Sum of all checksums to a v...

by jpzk.myopenid.com, October 16, 2007 21:37, 5 refactorings

It's very long and i just w...

Cf3ca7d0045e5f823c16d5f6b7687060 Talk
1
2
3
4
"""
For a given number, prints Pascal's Triangle upside-down up to that line.
Prints everything alligned at first, but starts screwing up at about 13.
...

Python Pascal's Triangle

by getopenid.com/ptn, October 04, 2007 11:57, 5 refactorings

Algorithms and Data Structu...

Avatar Talk
1
2
3
4
#! /usr/bin/python
""" A python primer. pydoc, doctest and classes.

...

Python Classtemplate

by griflet, October 03, 2007 02:15, 2 refactorings

I'm new to python (and to O...

Aae34a7973a8d98e53764a1c89090c55 Talk
1
2
3
4
def montage():
  topLeft = makePicture(getMediaPath("images-1.jpg")) # Top left picture, type in later
  topRight = makePicture(getMediaPath("images-2.jpg")) # Top Right picture, 
...

Python posterize

by goatmonkey.myopenid.com/, September 28, 2007 04:59, 5 refactorings

Creates a collage

Aa245e36dd988cb88f695c57ff86e02e Talk