Wednesday, April 06, 2011

PyCon: Hidden Treasures in the Standard Library

Hidden Treasures in the Standard Library

The talk was by Doug Hellmann. He writes Python Module of the Week. By the way, that is the most popular Python blog according to Google Reader, at least the last time I checked. Doug is publishing the series of blog posts as a book. Oh, and he's a nice guy :)

Side note: I met a guy who worked at a company that provided mapping software. The software was used by Google maps. He worked on the routing algorithms. He said the whole system consisted of 200 million lines of code. (I'm not sure how that's possible.) However, he also said that they distribute an SDK that contains .NET, the JRE, and Python within it.

Use the csv module with your own "dialects" to handle data that has fields with characters between each field.

SQLite3 has been added to the standard library. You can create custom column types in Python.

You can create signed, serialized data using the hmac library.

You can serialize data using the built in JSON support. Look at json.dumps(default=...).

You can override sys.excepthook with your own function.

You can create complex logging handlers. For instance, you can send non-verbose messages to the console, or you can send verbose messages to a log file. You can even combine these two things. For instance, you can configure it so that it logs tracebacks, only to file, and only on error.


dm said...

Hi JJ: Thanks for posting this series of summaries on PyCon talks. Thanks to you I've watched a bunch of talks on bliptv that I otherwise wouldn't have.

Shannon -jj Behrens said...

You're welcome! I'm glad you've enjoyed them!