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

(yzsuai) #1

an HTML rendition of this text in a spawned web browser is also available, but simple
text is sufficient for many people’s tastes.‡ The Cancel button makes this nonmodal
(i.e., nonblocking) window go away. More interestingly, the Source button pops up
PyEdit text editor viewer windows for all the source files of PyMailGUI’s implementa-
tion; Figure 14-3 captures one of these (there are many; this is intended as a demon-
stration, not as a development environment). Not every program shows you its source
code, but PyMailGUI follows Python’s open source motif.


New in this edition, help is also displayed in HTML form in a web browser, in addition
to or instead of the scrolled text display just shown. Choosing help in text, HTML, or
both is controlled by a setting in the mailconfig module. The HTML flavor uses the
Python webbrowser module to pop up the HTML file in a browser on the local machine,


Figure 14-2. PyMailGUI text help pop up


‡ Actually, the help display started life even less fancy: it originally displayed help text in a standard information
pop up common dialog, generated by the tkinter showinfo call used earlier in the book. This worked fine on
Windows (at least with a small amount of help text), but it failed on Linux because of a default line-length
limit in information pop-up boxes; lines were broken so badly as to be illegible. Over the years, common
dialogs were replaced by scrolled text, which has now been largely replaced by HTML; I suppose the next
edition will require a holographic help interface...


1022 | Chapter 14: The PyMailGUI Client

Free download pdf