Python Developer's Handbook

Book description

The Python Developer's Handbook is designed to expose experienced developers to Python and its uses. Beginning with a brief introduction to the language and its syntax, the book moves quickly into more advanced programming topics, including embedding Python, network programming, GUI toolkits, JPython, Web development, Python/C API, and more. Python is an interpreted, object-oriented programming language. Its syntax is simple and easy to learn, and it encourages programmers to write and think clearly. The Python Developer's Handbook is carefully written, well-organized introduction to this powerful, fast-growing programming language for experienced developers.

Table of contents

  1. Copyright
    1. Dedication
  2. About the Author
  3. Acknowledgments
  4. Tell Us What You Think!
  5. Introduction
  6. I. Basic Programming
    1. 1. Introduction
      1. Introduction to Python
        1. Python!? What Is It?
      2. Why Use Python?
        1. Readability
        2. It Is Simple to Get Support
        3. Fast to Learn
        4. Fast to Code
        5. Reusability
        6. Portability
        7. Object-Oriented Programming
        8. Overall Conclusion
      3. Main Technical Features
        1. Automatic Memory Management
        2. Exception Handling
        3. Rich Core Library
        4. Web Scripting Support and Data Handling
        5. Built-In Elements
        6. Development Flow
        7. Clear Syntax and a Diversity of Useful Lexical Elements
        8. Embeddable and Extendable
        9. Objects Distribution
        10. Databases
        11. GUI Application
        12. Introspection
        13. Third-Party Projects Integration
      4. Python Distribution
        1. System Requirements
      5. Installing and Configuring Python
        1. UNIX Environment
          1. Linux Installation
          2. Other UNIX Systems
        2. Macintosh Environment
        3. Windows Environment
      6. Python and Other Languages
        1. Python Versus C/C++
        2. Python Versus Perl
        3. Python Versus Tcl
        4. Python Versus Smalltalk
        5. Python Versus Java
          1. JPython
        6. Conclusion
      7. Patches and Bugs List
      8. PSA and the Python Consortium
        1. Support and Help
        2. Python Conferences and Workshops
      9. Summary
    2. 2. Language Review
      1. Language Review
      2. The Shell Environment
        1. Command Line Interpreter
      3. Programs
        1. Indentation
        2. Lexical Analysis
        3. Reserved Words
        4. Identifiers
      4. Built-In Data Types
        1. Immutable Data Types
        2. Mutable Data Types
        3. Numbers
        4. Strings
          1. Unicode Support
        5. True and False Logical Values
      5. Operators
        1. Augmented Assignment
      6. Expressions
        1. Built-In Functions
          1. apply()
          2. coerce()
          3. filter()
          4. globals()
          5. input()
          6. locals()
          7. map()
          8. open()
          9. pow()
          10. raw_input()
          11. reduce()
          12. __import__()
          13. reload()
        2. Sequence Functions
          1. range()
          2. xrange()
          3. len()
          4. max()
          5. min()
          6. zip()
        3. Object Manipulation
          1. setattr()
          2. getattr()
          3. hasattr()
          4. delattr()
          5. type()
          6. dir()
          7. callable()
          8. hash()
          9. id()
          10. vars()
        4. Mathematical/Logical Functions
          1. abs()
          2. cmp()
          3. round()
          4. divmod()
        5. Code Functions
          1. eval()
          2. exec()
          3. execfile()
          4. compile()
        6. Type Conversion
          1. int()
          2. long()
          3. float()
          4. complex()
          5. str()
          6. repr()
          7. tuple()
          8. list()
          9. chr()
          10. ord()
          11. hex()
          12. oct()
          13. unicode()
          14. unichr()
      7. Control Statements
        1. if/elif/else
        2. for
        3. while
        4. break/continue
          1. break
          2. continue
      8. Data Structures
        1. Lists
          1. Identifying an Entry
          2. Assigning Values to a List
          3. Assigning Values to a Slice
          4. Inserting Values
          5. Deleting a Value
          6. List Comprehension
        2. Built-In Methods
        3. Ranges
        4. Tuples
          1. Other Interesting Facts About Tuples
        5. Dictionaries (hash tables)
          1. Built-In Methods
      9. Functions and Procedures
        1. Functions
          1. Parameters
          2. Returning Values
          3. Built-In Methods
        2. Dynamic Namespace
      10. Modules and Packages
        1. Built-In Methods
        2. from in Contrast to import
        3. Releasing and Reloading Modules
      11. Input and Output
        1. Displaying Information
        2. Formatting Operations
      12. File Handling
        1. Opening a File
        2. Supported Methods
          1. read()
          2. readline()
          3. readlines()
          4. write()
          5. writelines()
          6. seek()
          7. tell()
          8. Fileno()
          9. flush()
          10. close()
          11. truncate()
        3. File Object Attributes
      13. Summary
      14. Code Example
    3. 3. Python Libraries
      1. Python Libraries
        1. The Library Reference
        2. The Standard Library of Modules
      2. Python Services
        1. sys
        2. sys.argv
        3. sys.exit()
        4. sys.modules
        5. sys.platforms
        6. sys.path
        7. sys.builtin_module_names
        8. sys.exc_info()
        9. sys.exc_type, sys.exc_value, sys.exc_traceback
        10. sys.last_type, sys.last_value and sys.last_traceback
      3. types
      4. UserDict
      5. UserList
      6. operator
      7. traceback
      8. linecache
      9. pickle
      10. cPickle
      11. copy_reg
      12. shelve
      13. copy
        1. copy.copy()
        2. copy.deepcopy()
      14. marshal
      15. imp
        1. imp.find_module()
        2. imp.load_module()
        3. imp.getsuffixes()
      16. parser
      17. symbol
      18. token
      19. keyword
        1. keyword.kwlist
        2. keyword.iskeyword()
      20. tokenize
      21. pyclbr
      22. code
      23. codeop
      24. pprint
      25. repr
      26. py_compile
      27. compileall
        1. compileall.compile_dir()
      28. dis
      29. new
      30. site
      31. user
      32. __builtin__
      33. __main__
      34. The String Group
        1. string
          1. string.split()
          2. string.atof()
          3. string.atoi()
          4. string.atol()
          5. string.upper()
          6. string.find()
          7. string.join()
          8. string.capitalize()
          9. string.capwords()
          10. string.lower()
          11. string.lstrip(),string.rstrip() and string.strip()
          12. string.ljust(),string.rjust() and string.center()
          13. string.replace()
          14. string.zfill()
          15. string.maketrans()
          16. string.translate()
        2. re
        3. regex
        4. regsub
        5. struct
        6. fpformat
        7. StringIO
        8. cStringIO
      35. Miscellaneous
        1. math
        2. cmath
        3. random
          1. random.choice()
          2. random.random()
          3. random.randint()
        4. whrandom
          1. whrandom.whrandom()
        5. bisect
        6. array
        7. ConfigParser
        8. fileinput
        9. calendar
        10. cmd
        11. shlex
      36. Generic Operational System
        1. os
          1. os.environ
          2. os.name
          3. os.getcwd()
          4. os.curdir
          5. os.listdir()
          6. os.rename()
          7. os.chmod()
          8. os.system()
          9. os.popen()
          10. os.remove()
          11. os.mkdir()
          12. os.rmdir()
          13. os.removedirs()
        2. os.path
          1. os.path.exists()
          2. os.path.isfile()
          3. os.path.isdir()
          4. os.path.split()
        3. dircache
        4. stat
        5. statcache
        6. statvfs
        7. cmp
        8. cmpcache
        9. time
          1. time.time()
          2. time.localtime()
          3. time.asctime()
          4. time.sleep()
        10. sched
        11. getpass
        12. curses
        13. getopt
        14. tempfile
          1. tempfile.mktemp()
          2. tempfile.TemporaryFile()
        15. errno
        16. glob
        17. fnmatch
          1. fnmatch.fnmatch()
          2. fnmatch.translate()
        18. shutil
          1. shutil.copyfile()
          2. shutil.rmtree()
        19. locale
        20. mutex
      37. Optional Operational System
        1. signal
        2. socket
        3. select
        4. thread
        5. threading
        6. Queue
        7. anydbm
        8. dumbdbm
        9. dbhash
        10. whichdb
        11. bsddb
        12. zlib
        13. gzip
        14. rlcompleter
      38. Debugger
      39. Profiler
      40. Internet Protocol and Support
        1. cgi
        2. urllib
        3. httplib
        4. ftplib
        5. gopherlib
        6. poplib
        7. imaplib
        8. nntplib
        9. smtplib
        10. telnetlib
        11. urlparse
        12. SocketServer
        13. BaseHTTPServer
        14. SimpleHTTPServer
        15. CGIHTTPServer
        16. asyncore
      41. Internet Data Handling
        1. sgmllib
        2. htmllib
        3. htmlentitydefs
        4. xmllib
        5. formatter
        6. rfc822
        7. mimetools
        8. MimeWrite
        9. multifile
        10. binhex
        11. uu
        12. binascii
        13. base64
        14. xdrlib
        15. mailcap
        16. mimetypes
        17. quopri
        18. mailbox
        19. mhlib
        20. mimify
        21. netrc
      42. Restricted Execution
        1. rexec
        2. Bastion
      43. Multimedia
        1. audioop
        2. imageop
        3. aifc
        4. sunau
        5. wave
        6. chunk
        7. colorsys
        8. rgbimg
        9. imghdr
        10. sndhdr
      44. Cryptographic
        1. md5
        2. sha
        3. mpz
        4. rotor
      45. UNIX Specific
        1. posix
        2. pwd
        3. grp
        4. crypt
        5. dlmodule
        6. dbm
        7. gdbm
        8. termios
        9. TERMIOS
        10. tty
        11. pty
        12. fcntl
        13. pipes
        14. posixfile
        15. resource
        16. nis
        17. syslog
        18. popen2
        19. commands
      46. SGI IRIX Specific
        1. al
        2. AL
        3. cd
        4. fl
        5. FL
        6. flp
        7. fm
        8. gl
        9. DEVICE
        10. GL
        11. imgfile
        12. jpeg
      47. Sun OS Specific
        1. sunaudiodev
        2. SUNAUDIODEV
      48. MS Windows Specific
        1. msvcrt
        2. winsound
      49. Macintosh Specific
        1. findertools
        2. macfs
        3. macostools
      50. Undocumented Modules
        1. Frameworks
        2. Miscellaneous Useful Utilities
          1. dircmp
          2. tzparse
          3. ihooks
        3. Platform Specific Modules
        4. Multimedia
        5. Obsolete
          1. ni
          2. dump
        6. Extension Modules
        7. New Modules on Python 2.0
      51. Summary
        1. Python Services
        2. The String Group
        3. Miscellaneous
        4. Generic Operational System
        5. Optional Operational System
        6. Debugger
        7. Profiler
        8. Internet Protocol and Support
        9. Internet Data Handling
        10. Restricted Execution
        11. Multimedia
        12. Cryptographic
        13. OS Specific (UNIX, SGI IRIX, SUN OS, MS Windows, and Macintosh)
        14. Undocumented Modules
        15. New Modules in Python 2.0
    4. 4. Exception Handling
      1. Exception Handling
      2. Standard Exceptions (Getting Help from Other Modules)
      3. Raising Exceptions
        1. Raising an Exception to Leave the Interpreter
        2. Raising an Exception to Leave Nested Loops
        3. Raising String Exceptions
        4. Instancing an Exception Class
        5. Debugging Your Code
      4. Catching Exceptions
        1. Catching Standard Errors
      5. try/finally
      6. Creating User-defined Exceptions
      7. The Standard Exception Hierarchy
      8. Summary
      9. Code Examples
    5. 5. Object-Oriented Programming
      1. Object-Oriented Programming
      2. An Introduction to Python OOP
        1. Class Instances
      3. Python Classes and Instances
        1. Attributes of a Class
        2. The Python Class Browser
          1. readmodule()
        3. Python Instances
          1. isinstance() and issubclass()
            1. isinstance()
            2. issubclass()
          2. Instance Attributes
      4. Methods Handling
        1. Accessing Unbounded Methods
        2. Handling Global Class Variables
        3. Calling Methods from Other Methods
      5. Special Methods
        1. Method Attributes
        2. Overloading Operators
      6. Inheritance
      7. Polymorphism
      8. Encapsulation
      9. Metaclasses
      10. Summary
      11. Code Examples
  7. II. Advanced Programming
    1. 6. Extending and Embedding Python
      1. Extending and Embedding Python
      2. The Python/C API
      3. Extending
        1. Creating New Extensions
        2. Importing an Extension Module
        3. Formatting Strings
        4. Exporting Constants
        5. Error Checking
          1. Handling Exceptions
        6. Reference Counting
        7. Building Extensions in C++
      4. Compiling and Linking Extension Modules
        1. Linking Static Extensions to the Interpreter
          1. Static Extensions on UNIX
          2. Static Extensions on Windows
        2. Linking Dynamic Extensions to the Interpreter
          1. Dynamic Extensions on UNIX
          2. Dynamic Extension on Windows
          3. Installing and Using Dynamic Modules
          4. Accessing Generic DLLs
      5. SWIG—The Simple Wrapper Interface Generator
      6. Other Wrappers
      7. Embedding
        1. Implementing Callback Functions
        2. Embedding the Python Interpreter
          1. Embedding on UNIX
        3. Embedding Python in C++
        4. Embedding Python in Other Applications
          1. NSAPI/NSAPY
      8. Summary
      9. Code Examples
        1. Wrapping C Functions
    2. 7. Objects Interfacing and Distribution
      1. Object Interfacing and Distribution
      2. Interfacing Objects
      3. Introduction to COM Objects
        1. The COM Specification
        2. COM Interfaces
          1. The Windows Registry
        3. ADO
        4. ActiveX
      4. Implementing COM Objects in Python
        1. The win32com Package
        2. Talking to Windows Applications
        3. Word and Excel
          1. Word
          2. Excel
        4. Visual Basic
          1. Handling Numbers and Strings
          2. Handling Lists and Tuples
        5. Delphi
      5. Distributing Objects with Python
        1. Inter-Language Unification (ILU)
        2. CORBA Binding and Implementation
        3. Fnorb
        4. DCOM
        5. OMF
        6. Hector
      6. Summary
      7. Code Examples
        1. Parking Lot (File parkinglot.py)
    3. 8. Working with Databases
      1. Working with Databases
      2. Flat Databases
        1. Text Data
        2. Binary Data—The struct Module
      3. DBM (Database Managers) Databases
        1. dbm Module
        2. gdbm Module
        3. bsddb Module
        4. dbhash Module
        5. anydbm Module
        6. dumbdbm Module
        7. whichdb Module
      4. Object Serialization and Persistent Storage
        1. pickle Module
        2. cPickle Module
        3. copy_reg Module
        4. marshal Module
        5. shelve Module
          1. Locking
        6. More Sources of Information
          1. PyVersant
          2. ZODB
      5. The ODBC Module
        1. ODBC Example for Windows Platforms
        2. mxODBC
        3. calldll
        4. unixODBC
        5. Other Interesting ODBC Web Pages
      6. ADO (ActiveX Data Objects)
      7. Using SQL
        1. SQL Mini-Tutorial
          1. Selecting the Information
          2. Relational Operators
          3. Joins
          4. Using Aggregate Functions
          5. Adding Data
          6. Deleting Data
          7. Updating Data
          8. Cool SQL Language Web Pages
        2. PostgreSQL Databases
          1. pg Module
        3. MySQL Modules
          1. MySQLdb Module
          2. Python Interface for MySQL
        4. The GadFly SQL Module
        5. MetaKit Database Engine
      8. Python DB API
        1. DB-API Specification v2.0
          1. Module Interface
          2. Connection Objects
          3. Cursor Objects
            1. executemany(operation,seq_of_parameters
            2. fetchone()
            3. fetchmany([size=cursor.arraysize])
            4. fetchall()
            5. nextset()
            6. arraysize
            7. setinputsizes(sizes)
            8. setoutputsize(size[,column])
          4. Type Objects and Constructors
          5. Implementation Hints
          6. Major Changes from Version 1.0 to Version 2.0
            1. Open Issues
          7. Footnotes
      9. Summary
    4. 9. Other Advanced Topics
      1. Other Advanced Topics
      2. Manipulating Images
        1. Python Imaging Library
        2. Other Modules
          1. imghdr Module
          2. GD Module
          3. WBMP Module
          4. PyOpenGL Module
      3. Working with Sounds
        1. winsound Module
        2. sndhdr Module
        3. wave Module
        4. aifc Module
        5. audiodev Module
      4. Restricted Execution Mode
        1. Protecting the Application Environment
      5. Scientific Computing
        1. Numerical Extensions
          1. Numeric.py (and Its Helper Modules multiarray, umath, and fast_umath)
          2. RandomArray.py (and Its Helper Module ranlib)
          3. FFT.py (and Its Helper Module fftpack)
          4. LinearAlgebra.py (and Its Helper Module lapack_litemodule)
          5. Installing NumPy
        2. Other Scientific Extensions
          1. ScientificPython
          2. Pyfort (The Python/Fortran Connection Tool)
          3. RNG
          4. pyclimate
          5. GmatH
          6. Real
        3. Computer Programming for Everybody
      6. Regular Expressions
        1. Regular Expression Functions and Object Methods
          1. re.compile()
          2. RegExpObject.search()
          3. RegExpObject.match()
          4. RegExpObject.findall()
          5. RegExpObject.split()
          6. RegExpObject.sub()
          7. RegExpObject.subn()
          8. re.search()
          9. re.match()
          10. re.findall()
          11. re.split()
          12. re.sub()
          13. re.subn()
          14. re.escape()
      7. Threads
        1. Python Threads
        2. Python Thread Modules
          1. Thread Module
          2. Threading Module
        3. Microthreads
      8. Summary
      9. Code Examples
        1. HTML Parsing Tool (File: parsing.py)
        2. TV Network Audiences (File: audience.py)
  8. III. Network Programming
    1. 10. Basic Network Background
      1. Networking
      2. Networking Concepts
        1. Protocols
        2. Addresses
        3. Sockets
          1. The socket Module
          2. Making Connections
          3. Asynchronous Sockets
            1. dispatcher ([socket])
          4. The select Module
      3. HTTP
        1. M2Crypto, by Ng Pheng Siong's
        2. CTC (Cut The Crap), by Constantinos Kotsokalis
        3. Alfajor, by Andrew Cooke
        4. Building Web Servers
          1. The SocketServer Module
          2. The BaseHTTPServer Module
          3. The SimpleHTTPServer Module
          4. The CGIHTTPServer Module
        5. Setting Up the Client Side of the HTTP Protocol
      4. Accessing URLs
        1. The urllib Module
        2. The urlparse Module
      5. FTP
        1. Transferring Data
      6. SMTP/POP3/IMAP
        1. Handling Email Services
      7. Newsgroups—Telnet and Gopher
      8. Summary
    2. 11. Web Development
      1. Web Development
      2. Configuring Web Servers for Python/CGI Scripts
        1. Python in Apache
          1. Configuring Apache for Python
          2. mod_python
          3. mod_pyapache
        2. AOLserver Web Server
        3. Microsoft IIS and PWS
      3. Third-Party Internet Applications
        1. Grail Web Browser
        2. Zope Web Application Server
        3. Mailman—GNU Mailing List Manager
        4. Medusa Internet Server
      4. Other Applications
        1. BSCW
        2. LDAP
        3. WebLog
          1. Parsing Modules
          2. Postprocessing Modules
      5. Site Management Tools
        1. WebDAV/PyDAV
        2. Zebra
        3. httpd_log
        4. Linbot
        5. Python-Friendly Internet Solution Providers (ISPs)
        6. mxCGIPython
        7. HTMLgen
        8. Document Template
        9. Persistent CGI
        10. Webchecker
        11. LinkChecker
        12. FastCGI
      6. Summary
    3. 12. Scripting Programming
      1. Web Programming
      2. An Introduction to CGI
      3. The cgi Module
        1. Functions
      4. Creating, Installing, and Running Your Script
        1. Sending Information to Python Scripts
        2. Working with Form Fields and Parsing the Information
        3. Security
        4. Sessions
        5. Data Storage
        6. Locking
        7. Cookies
          1. The Cookie.py Module
            1. Cookie.Cookie()
            2. cookie.output()
            3. cookie.load()
            4. Cookie.net_setfunc() and Cookie.user_setfunc()
        8. Creating Output for a Browser
          1. Using Templates
        9. Uploading/Uploaded Files
          1. cgiupload.py
        10. Environment Variables
        11. Debugging and Testing Your Script
      5. Python Active Scripting
        1. Using COM Objects
        2. ASP and Microsoft ActiveX Scripting
        3. Python Server Pages
      6. Summary
    4. 13. Data Manipulation
      1. Parsing and Manipulating Data
      2. XML Processing
        1. Introduction to XML
        2. Writing an XML File
        3. Python XML Package
          1. xmllib
          2. XMLParser()
          3. XML Namespaces
          4. XML Examples
          5. The SAX API
          6. DOM: The Document Object Model
          7. XSL Transformations (XSLT)
          8. XBEL—XML Bookmark Exchange Language
          9. RPC—What Is It?
          10. Simple Object Access Protocol (SOAP)
          11. PythonPoint
        4. Pyxie
      3. XML-RPC
        1. The Python Implementation
        2. Working with Zope
      4. XDR Data Exchange Format
        1. xdrlib
        2. Packer Objects
        3. Unpacker Objects
        4. Exceptions
      5. Handling Other Markup Languages
        1. sgmllib
        2. htmllib
        3. htmlentitydefs
        4. formatter
        5. The Formatter Interface
        6. Formatter Implementations
        7. The Writer Interface
        8. Writer Implementations
        9. Using the Formatter Module
      6. MIME Parsing and Manipulation
        1. rfc822
        2. mimetools
        3. MimeWriter
        4. multifile
        5. MultiFile (fp[, seekable])
        6. mailcap
        7. mimetypes
        8. base64
        9. quopri
        10. mailbox
        11. mimify
        12. Message Objects
        13. AddressListObjects
      7. Generic Conversion Functions
        1. netrc
        2. mhlib
        3. MHObjects
        4. Folder Objects
        5. Message Objects
          1. binhex
          2. uu
          3. binascii
      8. Summary
  9. IV. Graphical Interfaces
    1. 14. Python and GUIs
      1. Python GUI Toolkits
      2. The Tkinter Module
      3. Overview of Other GUI Modules
        1. Pythonwin/MFC
        2. wxPython
        3. STDWIN
          1. PyQt
        4. PyKDE
        5. Wpy
        6. PyGTK
          1. Gnome-Python
        7. PyOpenGL
        8. wafepython
        9. pyFLTK
        10. FXPy
        11. Motif
        12. PyAmulet
        13. DynWin
        14. JPI
          1. AWT
        15. FORMS
      4. Designing a Good Interface
      5. Summary
    2. 15. Tkinter
      1. Introduction to Tcl/Tk
      2. Tkinter
        1. Checking the Installation
        2. Hello Python World
      3. Geometry Management
        1. pack()
        2. grid()
        3. place()
      4. Handling Tkinter Events
        1. Mouse Events
        2. Keyboard Events
        3. Event Attributes
        4. Event Callbacks
        5. Protocols
      5. Tkinter Widgets
        1. Widget Standard Options
          1. height
          2. width
          3. background(bg) and foreground(fg)
          4. relief
          5. Highlight Settings
          6. borderwidth (bd)
          7. text
          8. justify
          9. font
          10. command
          11. variable
          12. image bitmap
          13. anchor
          14. padx pady
          15. cursor
        2. Widgets Reference
          1. Button
          2. Canvas
          3. Checkbutton
          4. Entry
          5. Frame
          6. Label
          7. Listbox
          8. Menu
          9. Menubutton
          10. Message
          11. Radiobutton
          12. Scale
          13. Scrollbar
          14. Text
          15. Toplevel
          16. Image
          17. BitmapImage
          18. PhotoImage
        3. General Widget Methods
          1. winfo (Widget Information) Methods
      6. Designing Applications
      7. PMW—Python Mega Widgets
      8. Tkinter Resources
      9. Summary
  10. V. Developing with Python
    1. 16. Development Environment
      1. Building Python Applications
      2. Development Strategy
        1. Optimizing the Code
        2. Style Guide
        3. Code Layout
        4. Comments
        5. Naming Styles and Conventions
      3. Integrated Development Environments
      4. IDLE
        1. Installing and Configuring IDLE
        2. Command Line Usage
        3. Python Shell
        4. Keyboard Commands
        5. File Menu
        6. The Class and the Path Browsers
        7. Edit Menu
        8. Windows Menu
        9. Debug Menu
          1. Go to file/line
          2. Stack Viewer
          3. Debugger
          4. Auto-open Stack Viewer
        10. Writing an IDLE Extension
        11. Python 2.0 and IDLE
      5. Pythonwin
        1. The Pythonwin Environment
        2. Keyboard Bindings
        3. Command Line Arguments
      6. Summary
    2. 17. Development Tools
      1. The Development Process of Python Programs
      2. Compiling Python
        1. Windows
        2. UNIX
      3. Editing Code
        1. Emacs
      4. Python Scripts
      5. Generating an Executable Python Bytecode
      6. Interpreter
      7. Debugging the Application
        1. The Base Debugger Module (bdb)
        2. The Python Debugger (pdb)
          1. Debugger Commands
        3. Disassembling Python Bytecodes
      8. Profiling Python
        1. Python Profiler
        2. Analyzing Profiles with the pstats Module
          1. Limitations
          2. Calibration
          3. Extensions: Deriving Better Profilers
      9. Distributing Python Applications
        1. SqueezeTool
        2. Python2C—The Python to C Translator
        3. Small Python
        4. Gordon McMillan's Installer
        5. Distutils
      10. Summary
  11. VI. Python and Java
    1. 18. JPython
      1. Welcome to JPython
        1. JPython Features
        2. CPython Versus Jpython
        3. JPython Resource Links
      2. Java Integration
        1. Java Certification
        2. Java Links
      3. Downloading and Installing JPython
        1. Downloading the CPython Library
        2. Licensing
        3. JVMs That Support JPython
          1. Linux
          2. Win32 (Windows NT, 95, and 98)
          3. Solaris
          4. Irix
          5. Macintosh
      4. The Interpreter
      5. The JPython Registry
        1. Registry Properties
        2. Finding the Registry File
      6. Creating Graphical Interfaces
      7. Embedding
        1. JPython in a Java Application
        2. Java in a JPython Application
      8. jpythonc
      9. Running JPython Applets
      10. Summary
  12. VII. Appendixes
    1. A. Python/C API
      1. Python/C API
        1. Include Files
        2. Objects, Types, and Reference Counts
          1. Reference Counts
            1. Reference Count Details
          2. Types
        3. Exceptions
        4. Embedding Python
      2. The Very High Level Layer
      3. Reference Counting
      4. Exception Handling
      5. Standard Exceptions
        1. Deprecation of String Exceptions
      6. Utilities
        1. OS Utilities
        2. Process Control
        3. Importing Modules
      7. Abstract Objects Layer
        1. Object Protocol
        2. Number Protocol
        3. Sequence Protocol
        4. Mapping Protocol
      8. Concrete Objects Layer
        1. Fundamental Objects
          1. Type Objects
          2. The None Object
        2. Sequence Objects
          1. String Objects
          2. Buffer Objects
          3. Tuple Objects
          4. List Objects
        3. Mapping/Dictionary Objects
        4. Numeric Objects
          1. Plain Integer Objects
          2. Long Integer Objects
          3. Floating Point Objects
          4. Complex Number Objects
            1. Complex Numbers as C Structures
            2. Complex Numbers as Python Objects
        5. Other Objects
          1. File Objects
          2. Module Objects
          3. C Objects
      9. Initialization, Finalization, and Threads
        1. Thread State and the Global Interpreter Lock
      10. Memory Management
        1. Memory Interface
        2. Examples
      11. Defining New Object Types
        1. Common Object Structures
        2. Mapping Object Structures
        3. Number Object Structures
        4. Sequence Object Structures
        5. Buffer Object Structures
    2. B. Running Python on Specific Platforms
      1. Python on Win32 Systems
      2. Python on MacOS Systems
      3. Python on UNIX Systems
      4. Other Platforms
        1. Python for OS/2
        2. Python for Windows 3.1
        3. Python for DOS
        4. Python for BeOS
        5. Python for VMS
        6. Python for Psion
        7. Python for Windows CE
        8. Python for Anything Else
    3. C. Python Copyright Notices
      1. Python 2.0 License Information
        1. HISTORY OF THE SOFTWARE
      2. Python's Copyright Notice (version 1.6)
      3. Python's Copyright Notice (until version 1.5.2)
      4. Copyright Notice of the profile and pstats Modules
      5. Copyright Notice of JPython with OROMatcher
      6. Copyright Notice of JPython without OROMatcher
    4. D. Migrating to Python 2.0
      1. Python 1.6 or Python 2.0. Which One to Choose?
      2. New Development Process
      3. Enhancements
        1. Unicode Support
        2. List Comprehension
        3. Strings Manipulation
        4. Augmented Assignment
        5. Garbage Collection
        6. Maximum Recursion
      4. Expected Code Breaking

Product information

  • Title: Python Developer's Handbook
  • Author(s):
  • Release date: December 2000
  • Publisher(s): Sams
  • ISBN: None