Figure PyForm displaying a shelf of Actor objects

PyForm uses a three-window interface to the table being browsed all windows are packed for proper window expansion and clipping, as set by the rules we studied earlier in this book. The window in the upper left of Figure 16-1 is the main window, created when PyForm starts it has buttons for navigating through a table, finding items by key, and updating, creating, and deleting records more useful when browsing tables that persist between runs . The table dictionary key of the record currently...

PyTree A Generic Tree Object Viewer 1

Python Object Oriented Canvas

Up to now, this chapter has been command-line-oriented. To wrap up, I want to show you a program that merges the GUI technology we studied earlier in the book with some of the data structure ideas we've met in this chapter. This program is called PyTree, a generic tree data structure viewer written in Python with the Tkinter GUI library. PyTree sketches out the nodes of a tree on screen as boxes connected by arrows. It also knows how to route mouseclicks on drawn tree nodes back to the tree, to...

ppembed A HighLevel Embedding API 1

But don't do that . As you can probably tell from the last example, embedded-mode integration code can very quickly become as complicated as extending code for nontrivial use. Today, no automation solution solves the embedding problem as well as SWIG addresses extending. Because embedding does not impose the kind of structure that extension modules and types provide, it's much more of an open-ended problem what automates one embedding strategy might be completely useless in another. With a...

Example PPEIntegrateEmbedApiClientsobjectserrlowc

include lt Python.h gt include lt stdio.h gt define error msg do printf s n, msg exit 1 while 1 main run objects with low-level calls and full error checking char arg1 sir, arg2 robin, cstr PyObject pmod, pclass, pargs, pinst, pmeth, pres instance module.klass Py Initialize error Can't load module pclass PyObject GetAttrString pmod, klass fetch module.class Py_DECREF pmod if pclass NULL error Can't get module.klass pargs Py_BuildValue if pargs NULL error Can't build arguments list pinst PyEval...