Most useful Python modules from the standard library? [closed]
Modules to cover in a 1-2 hour slot entirely depend on your audience's interest or focus. What other classes are they taking? What are they prepared to make use of immediately?
Be sure to mention math
, decimal
and datetime
and time
and re
.
For IT-types who will be doing file-oriented work: glob
, fnmatch
, os
, os.path
, tempfile
, and shutil
.
Database folks must hear about sqlite
and json
.
Simulation audience may want to hear about random
.
Web developers must hear about urllib2
from a client point of view. Also Beautiful Soup and an XML parser of your choice.
Web developers must hear about logging
and wsgiref
from a server point of view.
I'd offer itertools
and functools
. These modules operate over abstractions that are found everywhere in programming, so I think they are useful to study. Among more practical things, xml modules (xml.dom
, xml.sax
) can be very useful.
Have a look at PyMOTW (Python Module Of The Week). Although it is not strictly stdlib, it's a great resource of obvious and not so obvious gems of the python stdlib. What's more, it also serves as excellent documentation of the introduced modules.