Easily highlight source code for your blog with our Syntax Highlighter.
Join Siafoo Now
or
Learn More
Dive Into Python
0
Updated over 4 years ago (01 Jul 2008 at 06:42 PM)
recent activity
Snippets from the excellent book Dive Into Python by Mark Pilgrim.
For more information, visit http://www.diveintopython.org
Contents
|
|
|
convert | (3) |
|
|
url | (2) |
|
|
metadata | (2) |
|
|
string | (2) |
|
|
substrings | (1) |
|
|
classes | (1) |
|
|
open | (1) |
|
|
parse | (1) |
|
|
quotes | (1) |
|
|
dictionary comprehensions | (1) |
|
|
generator expressions | (1) |
|
|
tips | (1) |
|
|
functions | (1) |
|
|
Last-Modified | (1) |
|
|
filter | (1) |
|
|
thank-you note | (1) |
|
|
integer | (1) |
|
|
iterate | (1) |
|
|
file-like object | (1) |
|
|
SGMLParser | (1) |
|
|
ETag | (1) |
|
|
soundex | (1) |
|
|
generator | (1) |
|
|
pig latin | (1) |
|
|
pluralize | (1) |
|
|
dictionaries | (1) |
|
|
python | (1) |
|
|
web page | (1) |
|
|
headers | (1) |
|
|
tricks | (1) |
|
|
list operators | (1) |
|
|
Fibonacci sequence | (1) |
|
|
random | (1) |
|
|
reduce | (1) |
|
|
strings | (1) |
|
|
file | (1) |
|
|
roman numeral | (1) |
|
|
map | (1) |
|
|
id3 tags | (1) |
|
|
truthfulness | (1) |
|
|
read | (1) |
|
|
grammar | (1) |
|
|
HTML | (1) |
|
|
lambda functions | (1) |
|
|
zip | (1) |
|
|
switch statements | (1) |
|
|
unittest | (1) |
|
|
list comprehensions | (1) |
|
|
philosophy | (1) |
|
|
decorators | (1) |
|
|
mp3 | (1) |
Want to write shorter, cleaner code? Have an unfortunate situation where you need to fit as much as you can in one expression? Prefer a quick dose of hacks to spending the rest of your life...
Converts words to pig-latin! Also there is some cool regex magic.
Use the SGMLParser to retrieve a list of URLs from a web page.
Converts strings to their soundex equivalent. Soundex is a phonetic algorithm for indexing names by sound in English. This allows similarly-pronounced but differently-spelled words to be matched....
Call toRoman() to convert an integer to a roman numeral, or fromRoman() to convert a roman numeral to an integer....
Lets you take any input source -- URL, local pathname, network pathname, string -- and deal with it in a uniform manner. The returned object is guaranteed to have all the basic stdio read methods...
Renders Fibonacci sequences, up to a given maximum value, using a generator function.
Generates random philosophies based on the works of Kant and Husserl, thank you notes, and more using a context-free grammar....
A base class for an HTML processing module. Designed to take HTML as input and to output equivalent HTML....
Provides a framework to get filetype-specific metadata. Included is an example to parse ID3 tags (version 1) from MP3 files....
Easily and correctly pluralize most English nouns....
Pass a phone number to parsePhoneNumber, it will return a tuple of (Area Code, 3-Digit Trunk, 4-Digit Number, Extension).
Add a Comment