PLEAC-Python


Table of Contents
Foreword
1. Strings (100.0%)
2. Numbers (100.0%)
3. Dates and Times (100.0%)
4. Arrays (100.0%)
5. Hashes (100.0%)
6. Pattern Matching (91.7%)
7. File Access (82.6%)
8. File Contents (92.9%)
9. Directories (92.3%)
10. Subroutines (100.0%)
11. References and Records (96.9%)
12. Packages, Libraries, and Modules (92.5%)
13. Classes, Objects, and Ties (100.0%)
14. Database Access (66.7%)
15. User Interfaces (60.5%)
16. Process Management and Communication (68.2%)
17. Sockets (63.2%)
18. Internet Services (66.7%)
19. CGI Programming (63.3%)
20. Web Automation (59.4%)
A. Helpers

Foreword

Following the Perl Cookbook (by Tom Christiansen and Nathan Torkington, published by O'Reilly) spirit, the PLEAC Project aims to gather fans of programming, in order to implement the solutions in other programming languages.

In this document, you'll find an implementation of the Solutions of the Perl Cookbook in the Python language.

The latest version of Python is 2.4 but users of 2.3 and 2.2 (and in some cases earlier versions) can use the code herein. Users of 2.2 and 2.3 should install or copy code from utils.py (http://aima.cs.berkeley.edu/python/utils.py) [the first section provides compatability code with 2.4] Users of 2.2 should install optik (http://optik.sourceforge.com) [for optparse and textwrap] Where a 2.3 or 2.4 feature is unable to be replicated, an effort has been made to provide a backward-compatible version in addition to one using modern idioms. Examples which translate the original Perl closely but which are unPythonic are prefixed with a comment stating "DON'T DO THIS". In some cases, it may be useful to know the techniques in these, though it's a bad solution for the specific problem.