[Python编程(第4版)].(Programming.Python.4th.Edition).Mark.Lutz.文字版

(yzsuai) #1

Just like the PyForm example of the preceding chapter, the source code and documen-
tation for this example have been moved to the book’s examples package in this edition
to save real estate here. To study PyTree, see the following directory:


C:\...\PP4E\Dstruct\TreeView

Also like PyForm, the Documentation directory there has the original description of this
example that appeared in the third edition of this book; PyTree’s code is in Python 3.X
form, but the third edition overview may not be.


As mentioned, PyTree is set up to display both the binary search trees of this chapter
and the expression parse trees of the next chapter. When viewing the latter, PyTree
becomes a sort of visual calculator—you can generate arbitrary expression trees and
evaluate any part of them by clicking on nodes displayed. But at this point, there is not
much more I can show and/or tell you about those kinds of trees until you move on to
Chapter 19.


1404 | Chapter 18: Data Structures

Free download pdf