1 2 3 4
def get_combinations(sequence,joker=10): """ Checks duplicates in sequence, returns tuple with char and duplicate count ...
Python Poker sequence
get max length of duplicate...
1 2 3 4
def __init__(self, month, day, year): if type(month) != int: raise NotIntegerError, "month must be an integer" ...
Python Validating argument
by jluebbert.myopenid.com,
April 03, 2010 08:08,
4 refactorings, tagged with python, validation, initialization
I'm learning python and I w...
1 2 3 4
entries = BlogEntry.objects.filter(status=True,sticky=False,control_tags=controlTag)[offset:(offset+limit)] sticky_entries = BlogEntry.objects.filter(status=True,sticky=True,control_tags=controlTag) ...
Python Django combining querysets
When i combine this way, re...
1 2 3 4
import re def process_html(str): ...
Python Regexp extraction in Python
Is it good way to extract p...
1 2 3 4
numbers = [int(raw_input("enter number: "))] p = lambda x: ((x % 2) and x * 3 + 1) or x / 2 ...
Python algoritmo collatz
Considere que, para um dete...
1 2 3 4
def get_pos(rel_dates): """returns the positions of the dates closest to 25%, 50%, and 75%""" pos = [0] # first element ...
Python Return the indexes of speci...
The function takes an list ...
1 2 3 4
def scale_dates(dates): rel_dates = [] first_day = dates[0] ...
Python Scale data points with the ...
In order to print a chart t...
1 2 3 4
class MetaClass(type): def __new__(cls, name, bases, attrs): return super(MetaClass, cls).__new__(cls, name, bases, attrs) ...
Python How to dynamically pass bas...
I need to dynamically creat...
1 2 3 4
#!/usr/bin/python # Criado em:Dom 12/Ago/2007 hs 10:49 # Last Change: Dom 12 Ago 2007 11:11:06 BRT ...
Python equação do segundo grau
Equação do segundo graum em...
1 2 3 4
def slug_to_lower(fn): """ Decorator to lowercase string arguments to a function. ...
Python String args to lower decorator
This was used to convert Mi...
1 2 3 4
#? import PIL #? ...
Python Convert .pdf to .tiff
by setori88.myopenid.com,
October 20, 2008 07:04,
4 refactorings, tagged with python, open office, conversion, PIL
Hello all
As the title s...
1 2 3 4
#!/usr/bin/python import socket,time ...
Python Connection Detection script
by matthew.scouten.myopenid.com,
October 02, 2008 01:06,
3 refactorings, tagged with short, python, sockets
This is a Quick and Dirty s...
1 2 3 4
#!/usr/bin/python # -*- coding: utf-8 -*- ...
Python Parse XML from Yahoo weathe...
Is there a more efficient w...
1 2 3 4
#!/usr/bin/python # -*- coding: utf-8 -*- ...
Python Base64 image encoding and i...
Is this a correct a way to ...
1 2 3 4
#!/usr/bin/python # -*- coding: utf-8 -*- ...
Python Query TinyUrl the fastest way
I'm looking for the fastest...
1 2 3 4
i = 0 for j in ['foo', 'bar', 'baz'] puts "#{i} #{j}" ...
Ruby Python's enumerate in Ruby?
by robby86533.identity.net,
July 14, 2008 23:02,
3 refactorings, tagged with python, ruby, for, enumerate
What is the best way to emu...
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...
1 2 3 4
def segment_pages(page): page.paginator.left = [] page.paginator.right = [] ...
Python Django / Python / Paginatio...
Really quickly ported some ...
1 2 3 4
import re def addWord(token, frequencies): ...
Python Count word occurrences in a...
This code counts number of ...
1 2 3 4
class SearchLet(Form): district = Field(widget=SelectMultiple(choices=DISTRICTS, required=False) ...
Python Django models search
I'm using the following cod...
I wanna know if anyone can ...