spacer
spacer spacer spacer spacer spacer  
sign in | join
| spacer
spacer spacer spacer
spacer
spacer
spacer
spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer
spacer
spacer spacer spacer spacer spacer spacer
spacer
spacer spacer spacer
spacer Cookbook | Documentation | Mailing Lists | Products | User Groups | Web Services spacer
spacer
Submit Recipe
My Recipes

All Recipes
All Cookbooks


View by Category
Algorithms
CGI
Databases and ...
Debugging and Testing
Distributed Programming ...
Extending and Embedding ...
Files
Image and scientific ...
Jython
Network Resources
Object Oriented ...
Programs about programs ...
Searching and Sorting
Shortcuts
System Administration
Text (Including ...
Threads, Processes, ...
User Interfaces
Web Programming
XML Programming

spacer
spacer

Python Cookbook

Welcome to the Python Cookbook, a collaborative collection of your contributions to Python lore.

Python Cookbook code is freely available for use and review. We encourage you to contribute recipes (code and discussion), comments and ratings.

Thanks to everyone who submitted recipes and comments for the Python Cookbook Second Edition. The collection, co-edited with Alex Martelli and Anna Ravenscroft, is scheduled for publication in March, 2005.

Contributors whose recipes are used in the book will receive a complimentary copy of the Second Edition. A portion of all royalties will go to the non-profit Python Software Foundation.

Cheers and happy cooking!

David Ascher, Editor in Chief
Email: pythoncookbook@activestate.com


View:   Editors Pick | Approved | Not Approved | All
spacer
1-20 | 21-40 | 41-60 | 61-80 ( found 1814 recipes )
<< Previous next >>
spacer
spacer

chain execution of functions using generators (Vaibhav Bhatia)
This is a simple recipe which uses generators to execute a chain of functions. These functions and ...
Modified: 2006/11/17 21:52

spacer
spacer
spacer
spacer

Yielding out of nested routines by metaclass transformation (Bernhard Mulder)
Python 2.5 improved the support for generators, making it easier to use coroutines. If you want to ...
Modified: 2006/11/17 04:16

spacer
spacer
spacer
spacer

one liner frequency count (Jason Whitlark)
You often see frequency counts done with dicts, requiring serveral lines of code. Here is a way to ...
Rated: 3 out of 5 by 2 user(s), Modified: 2006/11/17 01:07

spacer
spacer
spacer
spacer

one liner frequency count (Jason Whitlark)
You often see frequency counts done with dicts, requiring serveral lines of code. Here is a way to ...
Rated: 3 out of 5 by 2 user(s), Modified: 2006/11/17 01:07

spacer
spacer
spacer
spacer

A self-cleaning dict-like container which limits the number and lifetime of its items (Michael Palmer)
This container stores its items both in a dict (for direct access) and in a bi-directionally linked ...
Modified: 2006/11/15 23:51

spacer
spacer
spacer
spacer

JavaScript code compression (Michael Palmer)
A regex-based kludge for JavaScript code compression. Safely handles string constants and missing ...
Modified: 2006/11/15 17:15

spacer
spacer
spacer
spacer

Yaptoo (Yaptu outrageously obfuscated) - or yet yet another templating utility (Michael Palmer)
An enhanced version of yaptu, with the following changes - separated parsing from execution - ...
Modified: 2006/11/15 16:58

spacer
spacer
spacer
spacer

reduce as a generator (kay schluehr)
In this recipe the builtin function reduce is generalized to a Python 2.5 style generator called ...
Modified: 2006/11/15 16:36

spacer
spacer
spacer
spacer

Server side JavaScript dependency resolution (Michael Palmer)
Purpose: Easing maintenance of JavaScript files and their inclusions in web pages by server-side ...
Modified: 2006/11/15 09:53

spacer
spacer
spacer
spacer

New Tail Recursion Decorator (kay schluehr)
A new tail recursion decorator that eliminates tail calls for recursive functions is introduced.
Rated: 4 out of 5 by 4 user(s), Modified: 2006/11/14 16:04

spacer
spacer
spacer
spacer

An easy password generator using standard Python modules (hemanth sethuram)
This recipe generates a password of any length using the standard library modules of Python. The ...
Rated: 2 out of 5 by 2 user(s), Modified: 2006/11/12 11:54

spacer
spacer
spacer
spacer

Deeply applying str() across a data structure (Danny Yoo)
The str() in the standard library behaves in a slightly weird way when applied against lists: on ...
Modified: 2006/11/12 03:23

spacer
spacer
spacer
spacer

Calculate the distance matrix for n-dimensional point array (Willi Richert)
Three ways to calculate a distance matrix out of a list of n-dimensional points using scipy.
Modified: 2006/11/11 22:56

spacer
spacer
spacer
spacer

A 200-line database engine (Pierre Quentel)
A fast, in-memory database management program in less than 200 lines The database object ...
Rated: 5 out of 5 by 2 user(s), Modified: 2006/11/11 11:08

spacer
spacer
spacer
spacer

Examples of algorithm composition with the observer pattern, using generator coroutines (Jim Baker)
Implements the toposort and strongly_connected_components graph algorithms, as a demonstration of ...
Modified: 2006/11/10 17:05

spacer
spacer
spacer
spacer

Implementing the observer pattern yet again: this time with coroutines and the with statement (Jim Baker)
Implements the observer design pattern via generator coroutines, wrapped up to use the new 'with' ...
Modified: 2006/11/10 16:38

spacer
spacer
spacer
spacer

Simple function base Genetic Algorithm (Ed Blake)
This is a solution to the first problem in this tutorial: www.ai-junkie.com/ga/intro/gat1.ht...
Modified: 2006/11/09 18:53

spacer
spacer
spacer
spacer

Composite design-pattern using dictionaries (Anand Pillai)
The recipe illustrates the composite design pattern by using hierarchical dictionaries. It can be ...
Modified: 2006/11/07 08:39

spacer
spacer
spacer
spacer

Lazy Traversal of Directed Graphs (Vincent Kraeutler)
The os.path.walk routine that ships with the python standard library is limited to traversing the ...
Modified: 2006/11/06 20:34

spacer
spacer
spacer
spacer

LRU cache decorator (Raymond Hettinger)
One-line decorator call adds caching to functions with hashable arguments and no keyword arguments. ...
Modified: 2006/11/06 00:45

spacer
spacer
spacer
spacer
1-20 | 21-40 | 41-60 | 61-80 ( found 1814 recipes )
<< Previous next >>
spacer

Except where otherwise noted, recipes in the Python Cookbook are published under the Python license .

spacer
spacer
spacer spacer spacer
spacer
spacer
advanced | search help
spacer

Highest rated recipes:

1. IPy Notify

2. Assignment in expression

3. Generalized delegates ...

4. Select the nth smallest ...

5. ObjectMerger

6. Minimal http upload cgi

7. Function Decorators by ...

8. Table objects with ...

9. wx twisted support using ...

10. More accurate sum

spacer

spacer
spacer
spacer
Privacy Policy | Email Opt-out | Feedback | Syndication
© 2006 ActiveState Software Inc. All rights reserved.
spacer
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.