I’ve recently started with Python, and am enjoying the ‘batteries included’ design. I’e already found out I can import time, math, re, urllib, but don’t know how to know that something is builtin rather than writing it from scratch.
What’s included, and where can I get other good quality libraries from?
Firstly, the python libary reference gives a blow by blow of what’s actually included. And the global module index contains a neat, alphabetized summary of those same modules. If you have dependencies on a library, you can trivially test for the presence with a construct like:
If you do this on startup for modules not necessarily present in the distribution you can bail with a sensible diagnostic.
The Python Package Index plays a role similar to that of CPAN in the perl world and has a list of many third party modules of one sort or another. Browsing and searching this should give you a feel for what’s about. There are also utilities such as Yolk which allow you to query the Python Package Index and the installed packages on Python.
Other good online Python resources are:
http://www.python.org
The comp.lang.python newsgroup – this is still very active.
Various of the items linked off the Python home page.
Various home pages and blogs by python luminaries such as The Daily Python URL, effbot.org, The Python Cookbook, Ian Bicking’s blog (the guy responsible for SQLObject), and the Many blogs and sites off planet.python.org.