1 2 3
def isSyncronized(self): if not (hasattr(self, "prog_name") and hasattr(self, "sync_file")): ...
Python On nested if blocks
by Peter Jensen,
August 06, 2010 20:28
1 2 3
from itertools import chain ...
1 2 3 4
#!/usr/bin/env python from twisted.internet.protocol import ClientCreator, Protocol ...
Python On Twisted tcp client
by https://www.google.com/accounts/o8/id?id=AItOawkapZWfDKPlzk45bKWi1klRG7GdRd4leuU,
July 01, 2010 07:21
Line ending is wrong. Shame...
1 2 3 4
class EasyFilter(object): def __init__(self, **kwargs): try: ...
1 2 3 4
class EasyFilter(object): def __init__(self, **kwargs): try: ...
1 2 3 4
import sys #input into this structure ...
Python On Williams Words
by cmurphycode.blogspot.com,
April 27, 2010 20:35
Oh My. A long journey took ...
Python On Validating argument
by Python Wackjob,
April 16, 2010 19:28
In general, it is considere...
1 2 3 4
def get_pos(rel_dates): """returns the positions of the dates closest to 25%, 50%, and 75%""" ret = [0] ...
Python On Return the indexes of speci...
by Colin Wallace,
April 13, 2010 22:43
I simply re-wrote redundant...
1 2 3 4
# Continuation of above self.day = day assert year >= 0, 'year must be an integer 0 or greater' ...
1 2 3 4
class X: self.valid_months = range(12) self.valid_days = range(1, 32) ...
1 2 3
# from http://www.djangosnippets.org/snippets/1103/ import MultiQuerySet entries = MultiQuerySet(sticky_entries, entries)
Python On Django combining querysets
by Matt Wilson,
April 10, 2010 09:12
Try this: http://www.django...
1 2 3 4
def __init__(self, month, day, year): assert type(month) is int, "month must be an integer" assert type(day) is int, "day must be an integer" ...
1
Notice Journey,neck vast basis payment floor consider national run government rise educational agree then trend selection component return master round therefore water price employee itself obvious need circumstance about sing ground crisis union problem sentence organise may responsible band pair project roll at stay used worker cut tend chapter officer wife notion season rate fight he means drug anyone price retain evidence success behind representation transfer thing customer someone lot design comparison apparent front membership avoid push demand narrow milk actual able vote name can
Python On Scale data points with the ...
by Hotels in Muenster vergleichen,
April 01, 2010 11:50
Notice Journey,neck vast ba...
1
perl -pi -e 's|<p><a.*||s'
Python On Regexp extraction in Python
by nicerobot,
March 17, 2010 17:28
If that's the entire file, ...
1 2 3 4
we have: -------- ...
Python On Regexp extraction in Python
by rullon.myopenid.com,
March 17, 2010 13:33
2nicerobot, thx for reply!
...
1 2 3 4
import re def process_html(str): ...
Python On Regexp extraction in Python
by nicerobot,
March 17, 2010 12:46
1. Regular Expressions Are ...
1 2
import itertools itertools.permutations([1,2,3],3)
1
(lambda n:(lambda i=[n]:reduce(lambda a,x:(x!=1 and i.append(x%2 and x*3+1 or x/2)) or a+[x],i,[]))())(22)
1 2 3 4
from bisect import bisect def pos(ls, x): ...
1 2 3 4
def space_out_camel_case(s): """Adds spaces to a camel case string. Failure to space out string returns the original string. >>> space_out_camel_case('DMLSServicesOtherBSTextLLC') ...
1 2 3 4
def permiter(ni): if not ni: yield [] ...
1 2 3 4
from django.db import models # Create your models here. ...
Python On Create a Dict from a Model
by Sam Thomson,
March 02, 2010 18:48
This uses list comprehensio...

I'd drop the return False; ...