Python Code Snippets

Paul Simmonds psimmo60 at
Fri Jul 4 11:12:09 CEST 2003

"Aurélien Géron" <ageron at> wrote in message news:<be1hs0$111s$1 at>...
> Hi,
> Does anyone know where I can find a lot of Python code snippets?
> I'm looking for a kind of organized list (GUI snippets, database access
> snippets, I/O snippets, etc.).  I find that there's no better way to learn a
> language than to be able to cut&paste actual working bits of code.
As well as the excellent resources others have mentioned, I'd
definately recommend investigating the Python source distribution, if
you haven't already. The joy of working with an Open Source language
is that there's no problem if you want to look at some decent code:

The Lib and Demo directories provide examples from the simple to the
not-so-simple in a variety of application domains.

The Objects and Include directories provide good examples of using the
Python-C API. Seeing how the objects are created under the hood has
increased my understanding of how Python works, and the quality of my
C extensions.

I'd also say the online Cookbook has a reasonable search facility, and
lists of recipies from different areas, so it is relatively easy to
find a particular code snippet.


More information about the Python-list mailing list