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.
| View: |
Editors Pick
|
Approved
|
Not Approved
|
All
|
 |
|
|
 |
|
Handling ANSI Terminal.
(Louis RIVIERE)
This function can be used, with or instead of print, to get ANSI output.
Modified: 2008/07/08 19:46
|
 |
 |
 |
|
Container
(Fouad Teniou)
Container can be used to contain sets of differents numbers and strings, and applying maths' ... Rated: 2 out of 5 by 1 user(s),
Modified: 2008/07/08 11:01
|
 |
 |
 |
|
WxFileRenamer - GUI app for renaming files by regular expressions
(Jack Trainor)
WxFileRenamer is a small GUI utility for renaming files in a directory with regular expressions, ...
Modified: 2008/07/07 12:41
|
 |
 |
 |
|
Selective cleanup (deletion) of files (based on category and extension) for use by a SABnzbd+ external post-processing script
(A B)
This script can be used to cleanup (delete) files with specific extensions, e.g. .sfv, .nzb, but ...
Modified: 2008/07/07 01:16
|
 |
 |
 |
|
Size of Python objects.
(Jean Brouwers)
This recipe may be useful to determine the size in bytes of a Python object or a collection of ...
Modified: 2008/07/03 17:23
|
 |
 |
 |
|
Recreate MS Access table in SQLite
(K. Killebrew)
A function to create and load a table in SQLite from a Microsoft Jet table, using DAO. Also ...
Modified: 2008/07/01 16:22
|
 |
 |
 |
|
Iterating Over Dates
(Michael Cornelius)
Iterate over a range of dates, [begin, end), day by day. By using datetime objects, rather than ...
Modified: 2008/06/30 07:51
|
 |
 |
 |
|
Line Oriented State Machine
(Jack Trainor)
State machine for processing text files on a line-by-line basis using regular
expressions to ...
Modified: 2008/06/30 05:13
|
 |
 |
 |
|
py3to2 - test/develop/integrate python 3.0 code natively under robust, software-rich python 2.5 environment
(kai zhu)
Modified: 2008/06/28 03:24
|
 |
 |
 |
|
py3to2 - test/develop/integrate python 3.0 code natively under robust, software-rich python 2.5 environment
(kai zhu)
Modified: 2008/06/28 03:23
|
 |
 |
 |
|
py3to2 - test/develop/integrate python 3.0 code natively under robust, software-rich python 2.5 environment
(kai zhu)
fjdls
Modified: 2008/06/28 03:21
|
 |
 |
 |
|
Modfying a local __dict__
(Oleg Sidorkin)
Works in python 2.4 and 2.5
Modified: 2008/06/25 10:00
|
 |
 |
 |
|
(Adam Feuer)
Python replacement for java.util.Properties - handles unicode escapes
Modified: 2008/06/24 20:35
|
 |
 |
 |
|
Extended optparse to allow definition of required options.
(Alec Wysoker)
Add "required" keyword to optparse.OptionParser.add_option()
Modified: 2008/06/24 13:26
|
 |
 |
 |
|
Converter
(Fouad Teniou)
Converter can be used to convert fundamental measures, metric, mass, liquid and temperature.
The ...
Modified: 2008/06/24 11:46
|
 |
 |
 |
|
sshfs mount tool
(Sven Bröckling)
This script uses sshfs ans fusermount to mount ssh ressources to local filesystems. It makes it ...
Modified: 2008/06/24 07:31
|
 |
 |
 |
|
Update stock quote using Yahoo! Finance web services
(Wai Yip Tung)
This script update the stock quote on your spreadsheet by fetching the latest quote from ... Rated: 4 out of 5 by 1 user(s),
Modified: 2008/06/22 18:33
|
 |
 |
 |
|
Treat the Win32 Registry like a Python dict -- updated (again!)
(Chris Melville)
This class wraps most of the win32api functions for accessing a registry. It will read and write ...
Modified: 2008/06/21 08:12
|
 |
 |
 |
|
Method signature type checking decorator for Python 3000
(Dmitry Dvoinikov)
This recipe allows nice and clean validation for method parameters/return values. It uses function ... Rated: 5 out of 5 by 1 user(s),
Modified: 2008/06/20 04:55
|
 |
 |
 |
|
Size of Python objects (revised).
(Jean Brouwers)
This recipe is an enhancement of recipe #544288 to determine the size of Python objects in bytes, ...
Modified: 2008/06/19 22:50
|
 |
 |
 |
 |
|
|
 |
Except where otherwise noted, recipes in the Python Cookbook are
published under the Python license .