O'Reilly logo

Python in a Nutshell, 2nd Edition by Alex Martelli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Python Resources

The richest of all Python resources is the Internet. The best starting point is Python’s site, http://www.python.org, which is full of interesting links to explore. http://www.jython.org is a must if you have any interest in Jython. For IronPython, at the time of writing the most relevant site is http://workspaces.gotdotnet.com/ironpython, but the IronPython team’s near-future plans include reviving the site http://ironpython.com; by the time you read this, http://ironpython.com should be back in its role as the primary IronPython web site.

Documentation

Python, Jython, and IronPython come with good documentation. The manuals are available in many formats, suitable for viewing, searching, and printing. You can browse the manuals on the Web at http://www.python.org/doc/current/. You can find links to the various formats you can download at http://www.python.org/doc/current/download.html, and http://www.python.org/doc/ has links to a large variety of documents. For Jython, http://www.jython.org/docs/ has links to Jython-specific documents as well as general Python ones. The Python FAQ (Frequently Asked Questions) document is at http://www.python.org/doc/FAQ.html, and the Jython-specific FAQ document is at http://www.jython.org/cgi-bin/faqw.py?req=index.

Most Python documentation (including this book) assumes some software development knowledge. However, Python is quite suitable for first-time programmers, so there are exceptions to this rule. A few good introductory online texts for nonprogrammers are:

Newsgroups and Mailing Lists

The URL http://www.python.org/community/lists/ has links to Python-related mailing lists and newsgroups. Always use plain-text format, not HTML, in any message you send to mailing lists or newsgroups.

The Usenet newsgroup for Python discussions is comp.lang.python. The newsgroup is also available as a mailing list. To subscribe, send a message whose body is the word “subscribe” to . “Dr. Dobb’s Python URL!,” an interesting weekly collection of the most notable news and Python resources, is regularly posted to comp.lang.python. All issues, in reverse chronological order (most recent first), can be found by visiting the URL:

A somewhat similar daily list of Python news can be found at http://www.pythonware.com/daily/.

Python-related announcements are posted to comp.lang.python.announce. To subscribe to its mailing-list equivalent, send a message whose body is the word “subscribe” to . To subscribe to Jython’s mailing list, visit http://lists.sf.net/lists/listinfo/jython-users. To ask for individual help with Python, email your question to . For questions and discussions about using Python to teach or learn programming, write to .

Special-Interest Groups

Discussions on some specialized subjects related to Python take place on the mailing lists of Python Special Interest Groups (SIGs). The page at http://www.python.org/sigs/ has a list of active SIGs and pointers to general and specific information about them. Over a dozen SIGs are active at the time of this writing. Here are a few examples:

http://www.python.org/sigs/c++-sig/

Bindings between C++ and Python

http://www.python.org/sigs/i18n-sig/

Internationalization and localization of Python programs

http://www.python.org/sigs/image-sig/

Image processing in Python

Python Business Forum

The Python Business Forum (PBF), at http://www.python-in-business.org/, is an international society of companies that base their businesses on Python. The PBF’s site offers interesting information about some of the many business uses of Python.

Python Journal

The Python Journal, http://pythonjournal.cognizor.com/, is a free online publication that focuses on Python, how to use it, and its applications.

Extension Modules and Python Sources

A good starting point to explore the world of available Python extensions and sources is the Python Cheese Shop, http://www.python.org/pypi, which currently contains more than 1,200 packages with descriptions and pointers. Another good one is “The Vaults of Parnassus,” available at http://www.vex.net/parnassus/, which has over 2,000 classified and commented links. By following these links, you can find and download most freely available Python modules and tools.

The standard Python source distribution contains excellent Python source code in the standard library and in the Demos and Tools directories, as well as C source for the many built-in extension modules. Even if you have no interest in building Python from source, I suggest you download and unpack the Python source distribution for study purposes.

Many Python modules and tools covered in this book also have dedicated sites. References to these sites are included in the appropriate chapters in this book.

The Python Cookbook

ActiveState’s web site http://www.activestate.com/ASPN/Python/Cookbook hosts a living collection of Python recipes. Each recipe contains Python code, comments, and discussion, contributed by volunteers and enriched by readers, under the editorial supervision of David Ascher. All code is covered by a license similar to Python’s. Everyone is invited to participate as author and reader in this community endeavor. Hundreds of recipes from the site—edited, commented, and grouped into chapters with introductions by Python experts—are published by O’Reilly as the Python Cookbook, edited by Alex Martelli, Anna Martelli Ravenscroft, and David Ascher.

Books and Magazines

Although the Net is a rich source of information, books and magazines still have their place (if you and I didn’t agree on this, I wouldn’t have written this book, and you wouldn’t be reading it). At the time of this writing, the only magazine entirely devoted to Python is Py (for up-to-date information, visit http://www.pyzine.com/).

Books about Python and Jython are numerous. Here are a few that I recommend, although many of them cover older versions of the language rather than current ones:

  • If you are just starting to learn Python (but have some previous programming experience), Learning Python, by Mark Lutz and David Ascher (O’Reilly), will serve you well. It sticks to the basics of Python’s language and core libraries, covering clearly and in depth each of the subjects it touches.

  • Python Web Programming, by Steve Holden (New Riders), teaches the basics of both Python and many other technologies that can help you build dynamic web sites, including TCP/IP, HTTP, HTML, XML, and relational databases. The book offers substantial examples, including a complete database-backed site.

  • Dive Into Python, by Mark Pilgrim (APress), teaches by example in a fast-paced and thorough way that is very suitable for people who are already expert programmers in other languages. You can also freely download the book, in any of several formats, from http://diveintopython.org/.

  • Beginning Python: From Novice to Professional, by Magnus Lie Hetland (APress), teaches both by thorough explanations and by fully developing 10 complete programs in various application areas.

  • Python Programming on Win32, by Mark Hammond and Andy Robinson (O’Reilly), is indispensable for optimal Python use on Windows. The book details platform-specific extensions to Python for COM, ActiveScripting, Win32 API calls, and integration with Windows applications. The current edition uses Python’s old 1.5.2 version, but everything also applies to Python’s current version.

  • Jython Essentials, by Samuele Pedroni and Noel Rappin (O’Reilly), is a rich and concise book on Jython, suitable if you already have some Java knowledge. For effective Jython use, I also suggest Java in a Nutshell, by David Flanagan (O’Reilly).

  • Python Essential Reference, by David Beazley (New Riders), is a complete reference to the Python language and its standard libraries.

  • Python Standard Library, by Fredrik Lundh (O’Reilly), offers terse and usable coverage of all modules in the standard Python library, with over 300 well-commented scripts to show how you can use each module. The amount and quality of examples stands out as the book’s outstanding feature.

  • For a very concise summary reference and reminder of Python’s essentials, check out Python Pocket Reference, also by Mark Lutz (O’Reilly).

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required