© Copyright 2000-2020 Source Code Online. Free Source Code and Scripts Downloads.
|Code Listing by Michele Simionato|
Twisted FAQs clearly state that "deferreds do not magically convert blocking
code into non-blocking code". So, how do you magically convert blocking
code into non-blocking code?
This recipe is the solution!
This recipe provides a semi-automatic mechanism to close resources.
Dot is a very nice graph description language developed
at MIT and available for free at http://www.graphviz.org/ .
Combined with Python, it makes an ideal tool to automatically
I will describe here a short...
Makes cooperative calls looks nicer: super.method instead of super(cls,self).method .
Any serious user of metaclasses has been bitten at least once by the
infamous metaclass/metatype conflict. Here I give a general recipe to
solve the problem, as well as some theory and some examples.
A short idiom for
s.endswith(ending1) or s.endswith(ending2) or s.endswith(ending3) or ...
Shows the goodies of the Python 2.3 itertools module and summarizes a
discussion on c.l.py (thread "a better str.endswith", July 2003)
The module optparse was a great addition to Python 2.3, since it is much more
powerful and easier to use than getopt. Using optparse, writing command-line
tools is a breeze. However, the power of optparse comes together with a certain
Regular string interpolation in Python requires the user to pass an explicit
keyword dictionary. This recipe adds a little bif of magic, so that if
a name is not found in the passed dictionary, it is looked up in the
This cookbook contains many recipes to memoize functions, however a recipe to
memoize classes was missing. Using this recipe you can cache object
creation, i.e. __new__ and __init__ methods are called only when needed.
For a good...
The doctester extracts code from stdin and tests it using the doctest module in
the standard library. It can be invoked from the command line, but it is
best called from you editor of choice. I just give an example for Emacs.
All files and free downloads are copyright of their respective owners. We do not provide any hacked, cracked, illegal, pirated version of scripts, codes, components downloads. All files are downloaded from the publishers website, our file servers or download mirrors. Always Virus check files downloaded from the web specially zip, rar, exe, trial, full versions etc. Download links from rapidshare, depositfiles, megaupload etc not published.