2009 210

From XPUB & Lens-Based wiki
Revision as of 12:54, 31 March 2009 by Michael Murtaugh (talk | contribs) (→‎Morning)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Morning

A small CGI exercise using List Comprehensions.

and of course, tutorials

Unicode

Text source:

import re
words = re.split(r"\s+", text)
words = [w for w in words if w]
# print words
# print " ".join( [w.upper().encode("utf-8") for w in words if len(w) == 4] )
print " ".join( [w.lower().encode("utf-8") for w in words if w[0] == "e"] )